def main(): from sys import stdin readline=stdin.readline n,z = map(int, readline().split()) if n >= 3: print('No') elif n == 1: if z >= 2: print('Yes') else: print('No') elif n == 2: st = set(y*y for y in range(1, 10**6+1)) z *= z for x in range(1, 10**6+1): x *= x if z-x in st: print('Yes') break else: print('No') main()