import sys input = sys.stdin.readline from fractions import Fraction eps=0.00000000001 A,B=input().split() A=Fraction(A) B=Fraction(B) if B<0: B=-B A=1/A if B>5: B-=int(B)-1 x=A**B if abs(round(x)-x)>=eps: print("No") exit() x=A.numerator y=A.denominator z=B.numerator w=B.denominator flag=0 u=x**(1/w) v=y**(1/w) if abs(round(u)-u)