A,B=input().split() if A[-4:]!="0000": assert False print("No") exit() if B[0]=="-": assert False print("No") exit() A=int(A[:-5]) z=int(B[:-5]+B[-4:]) w=10000 ans="No" for i in range(2,200000): x=0 a=A while a%i==0: a//=i x+=1 if a!=1: continue if (x*z)%w==0: ans="Yes" print(ans)