using System; namespace _648 { class Program { static void Main(string[] args) { long n = long.Parse(Console.ReadLine()); long a = (long)Math.Sqrt(n * 2); if (a * (a + 1) / 2 == n) { Console.WriteLine("YES"); Console.WriteLine(a); } else { Console.WriteLine("NO"); } } } }