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