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