s = int(input()) for i in range(1000000): v = pow(i, 2, 1000000) if v == s: print("YES") exit() print("NO")