import math n = int(input()) i = (-1 + math.sqrt(1 + 8*n)) / 2 if math.modf(i)[1] == 0.: print("YES") print(i) else: print("NO")