from math import gcd A, B = map(int, input().split()) x = B // gcd(A, B) while not x % 2: x //= 2 while not x % 5: x //= 5 print('No' if x == 1 else 'Yes')