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