import math n = float(input()) from decimal import * getcontext().prec = 28 t = Decimal(4 * n) / Decimal(1 + math.sqrt(1 + 8 * n)) if t % 1 == 0: print("YES") print(int(t)) else: print("NO")