def fz(): n,z=map(int,input().split()) zn=z**n for x in range(1,z): y=(zn-x**n)**(1/n) if y.is_integer(): return 'Yes' return 'No' print(fz())