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=round(float(input())*10000) B=round(float(input())*10000) ans="Yes" for p,e in Factorize(A).items(): if 4*B%10000: ans="No" print(ans)