N = gets.to_i t = Integer.sqrt(2 * N) puts N == t * (t + 1) / 2 ? "YES\n#{t}" : 'No'