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); WriteLine(a * (a + 1) / 2 == n? $@"YES {a}" : "NO"); } }