import math from decimal import * getcontext().prec = 40 n = int(input()) s, t = 1, int(2e9) def f(x): return (Decimal(x) * Decimal(x + 1) / Decimal(2)) while(s <= t): x = (s + t) // 2 if f(x) == n: print("YES") print(x) break elif f(x) > n: t = x - 1 else: s = x + 1 else: print("NO")