import math a, b = map(int, input().split()) g = math.gcd(a, b) a //= g b //= g for i in [2, 5]: while b % i == 0: b //= i print("Yes") if b != 1 else print("No")