n,z = map(int, input().split()) count = 0 for i in range(1,1001): for j in range(1,1001): if i**n + j**n == z**n: count += 1 break if count != 0: print('Yes') else: print('No')