A, B = input().split() A = int(A.replace('.', '')) B = int(B.replace('.', '')) for i in range(2, 10 ** 5): e = 0 while A % i == 0: A //= i e += 1 if i == 2 or i == 5: e -= 4 if e * B >= 0 and e * B % 10000 > 0: exit(print("No")) if A > 1: if B < 0 or B % 10000 > 0: exit(print("No")) print("Yes")