import math n = float(input()) t = (math.sqrt(1 + 8 * n) - 1) / 2 if t % 1 == 0: print("YES") print(int(t)) else: print("NO")