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