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