n, z = map(int, input().split()) zn = z**n ans = False for i in range(1, z+1): ipn = i**n sb = zn - ipn sqr = sb ** (1 / n) if sqr != 0 and sqr == int(sqr): ans = True break print("Yes" if ans else "No")