n, z = map(int, input().split()) for x in range(1, min(z, 10 ** 6) + 1): yt = (z ** n - x ** n) ** (1. / n) for y in range(max(1, int(yt) - 2), int(yt) + 3): if x ** n + y ** n == z ** n: print('Yes') exit() print('No')