Last active
April 30, 2017 15:06
-
-
Save IKKO-Ohta/a9394c8915b96bc711ca908825cab559 to your computer and use it in GitHub Desktop.
ABC60[B],Choose Integers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fractions import gcd | |
nums = [int(x) for x in input().split()] | |
def ngcd(nums): | |
d = 0 | |
for num in nums: | |
d = gcd(d,num) | |
return d | |
t = ngcd(nums) | |
if t != 1: | |
nums = [int(num / t) for num in nums] | |
t = gcd(nums[0],nums[1]) | |
if t == 1: | |
print('YES') | |
else: | |
print('NO') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment