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) and int(float(A)*10000)*int(AA*10000)==100000000: A=str(int(AA//1))+'.0000' B=B[1:] if B[0]=='-': print('No') exit() if A=='0.0000': print('No') exit() if A[-4:]=='0000' and B[-4:]=='0000' and B[0]!='-': 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: #print(i,j,BB,BB*j/10000) c=BB*j/10000 if c==c//1: print('Yes') exit() print('No')