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