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