import strutils,math template get*():string = stdin.readLine().strip() proc sqrt(n:int):int = n.float.sqrt.int let n = get().parseInt() let c = 1 + 8 * n if c.sqrt * c.sqrt != c or c.sqrt mod 2 == 0: quit "NO",0 echo "YES\n",(c.sqrt - 1 ) div 2 # x * (x+1) div 2 == n