def nibuntansaku(s): left = 0 right =s while right -left > 1: mid = (left + right)//2 if mid*(mid+1)//2 >= s: right =mid else: left =mid return right n =int(input()) a =nibuntansaku(n) if a*(a+1)//2 ==n: print("YES\n{}".format(a)) else: print("NO\n")