from math import gcd a,b = input().split() if b=="0.0000": exit(print("Yes")) a = int(a[:-5]+a[-4:]); b = int(b[:-5]+b[-4:]); c = d = 10000 e = gcd(a,c); f = gcd(b,d); a //= e; b //= f; c //= e; d //= f if b<0: a,c = c,a if c>1: exit(print("No")) for i in range(1,a+1): if i**d==a: exit(print("Yes")) if i**d>a: break print("No")