import math def solve(x): r = math.sqrt(2 * x) for i in range(math.ceil(r) - 1, math.floor(r)): if i * (i + 1) == 2 * x: return "YES\n{}".format(i) return "NO" n = int(input()) print(solve(n))