n,z = map(int,input().split()) if n == 1: if z - 1 > 0: print("Yes") else: print("No") exit() for i in range(1,z): for j in range(1,z): if pow(i,n) + pow(j,n) == z**n: print("Yes") exit() print("No")