A,B=input().split() if A=='1.0000': print('Yes') exit() BB=int(B.replace('.','')) if B=='0.0000': print('Yes') exit() if B[0]=='-': AA,BB=1//float(A),float(B)*(-1) if AA==int(AA//1): A=str(int(AA//1))+'.0000' B=B[1:] if A[-4:]=='0000' and B[-4:]=='0000': print('Yes') exit() if A[-4:]!='0000': print('No') exit() A=int(A.replace('.',''))//10000 for i in range(2,5*10**4): s=i for j in range(2,10**5): s*=i if s>A: break elif s==A: if (BB*j)%10000==0 and BB>0: print('Yes') exit() print('No')