package net.ipipip0129.kotlin.yukicoder import kotlin.math.sqrt fun main(args: Array) { val n = readLine()!!.toLong() val m = sqrt((n*2).toDouble()).toInt() println(if ((m*(m+1)/2).toLong() == n) "YES\n" + m else "NO") }