using System; using System.Collections.Generic; using System.Linq; using static System.Console; class Program { static void Main() { var n = long.Parse(ReadLine()); var a = (long)Math.Sqrt(2 * n); var b = false; var c = 0L; for (long i = a - 4; i < a + 9; i++) { if (i * (i + 1) / 2 == n) { b = true; c = i; } } WriteLine(b ? "YES" : "NO"); if (b) WriteLine(c); } }