n,z=map(int,input().split()) for x in range(1,z+1): rem=pow(z,n)-pow(x,n) for y in range(1,int(rem**(1/n))+10): if pow(y,n)==rem: print('Yes') exit() print('No')