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