A, B = input().split() if A[-4:] != "0000": exit(print("No")) a, _ = A.split(".") a = abs(int(a)) if a == 1: exit(print("Yes")) if B[0] == "-": exit(print("No")) _, b = B.split(".") b = int(b) if b == 0: exit(print("Yes")) if 10000%b != 0: print("No") else: n = 10000//b if a**(1/n)%1 == 0: print("Yes") else: print("No")