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