def gcd(a, b): if b == 0: return a return gcd(b, a % b) a, b = map(int, input().split()) b //= gcd(a, b) while b % 2 == 0: b //= 2 while b % 5 == 0: b //= 5 if b == 1: print("NO") else: print("YES")