import math n = int(input()) i = int((-1 + math.sqrt(1 + 8 * n)) / 2) for pfx in range(-10, 10): if ((i + pfx)**2 + (i + pfx)) / 2 == n: print("YES") print(i + pfx) else: print("NO")