from collections import defaultdict def Factorize(N): assert N>=1 factors=defaultdict(int) for p in range(2,N): if p**2>N: break while N%p==0: factors[p]+=1 N//=p if N!=1: factors[N]+=1 return factors A,B=map(float,input().split()) A=round(A*10000) B=round(B*10000) x,y=A,10000 if B<0: B=-B x,y=y,x cnt=defaultdict(int) for p,e in Factorize(x).items(): cnt[p]+=e*B for p,e in Factorize(y).items(): cnt[p]-=e*B ans="Yes" for p,e in cnt.items(): if e%10000 or e<0: ans="No" print(ans)