import math

n = int(input())
x = 8 * n + 1

s = math.isqrt(x)
if s * s == x:
    if s % 2 == 1:
        i = (s - 1) // 2
        print("YES")
        print(i)
    else:
        print("NO")
else:
    print("NO")