n,z=map(int,input().split()) if n==1: print("Yes") else: for x in range(1,10**3+1): if x>z: break for y in range(x,10**3+1): if x**n+y**n==z**n: print("Yes") sys.exit() elif x**n+y**n>z**n: break print("No")