defmodule Main do def input, do: IO.read(:line) |> String.trim def ii, do: input() |> String.to_integer def li, do: input() |> String.split |> Enum.map(&String.to_integer/1) def main do n = ii() x = trunc(:math.sqrt(2 * n)) if 2*n == x*(x+1) do IO.puts "YES" IO.puts x else IO.puts "NO" end end end