n,Z = map(int,input().split()) ans = "No" for i in range(1,Z): for j in range(1,Z): if (i**n + j**n) == Z**n: ans = "Yes" print(ans)