from math import gcd a, b = map(int, input().split()) b //= gcd(a, b) ans = 'Yes' if 10**10000 % b else 'No' print(ans)