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