def factorization(n): arr = [] temp = n for i in range(2, int(-(-n**0.5//1))+1): if temp%i==0: cnt=0 while temp%i==0: cnt+=1 temp //= i arr.append([i, cnt]) if temp!=1: arr.append([temp, 1]) return arr A, B = input().split() A1, A2 = A.split(".") B1, B2 = B.split(".") A1, A2, B1, B2 = int(A1), int(A2), int(B1), int(B2) if A2: print("No") exit() if B2 == 0: print("Yes") exit() L = factorization(A1) for a, v in L: if v * (B1 * 10000 + B2) % 10000: print("No") exit() print("Yes")