n, z = map(int, input().split()) z = z ** n vs = set() for x in range(10**6+1): x = x**n if x > z: print("No") break vs.add(x) if z-x in vs: print("Yes") break