Advertisement
Guest User

Untitled

a guest
Apr 30th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. from fractions import gcd
  2. nums = [int(x) for x in input().split()]
  3.  
  4. def ngcd(nums):
  5. d = 0
  6. for num in nums:
  7. d = gcd(d,num)
  8. return d
  9.  
  10.  
  11. t = ngcd(nums)
  12. if t != 1:
  13. nums = [int(num / t) for num in nums]
  14.  
  15. t = gcd(nums[0],nums[1])
  16. if t == 1:
  17. print('YES')
  18. else:
  19. print('NO')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement