n,z = map(int,input().split()) ans = 0 for x in range(1,z+1): w = pow(z,n)-pow(x,n) for y in range(1,z+1): if pow(y,n)>w:break if pow(y,n)==w: ans += 1 break if ans>0: print("Yes") else: print("No")