import strutils import math let n = 2 * stdin.readLine.parseInt() let k = int(sqrt(float(n))) if n == k * (k + 1): echo "YES" echo k else: echo "NO"