import scala.io.StdIn.readLong import scala.math._ @main def yuki648(): Unit = val n = 2 * readLong val k = round(sqrt(n.toDouble)).toLong if n == k * (k + 1) then println("YES") println(k) else println("NO")