import math n = int(input()) a = math.sqrt(1 + 8 * n) a = round(a) if(a*a == 1 + 8 * n): x = (-1 + a) / 2 if(x.is_integer()): print("YES") print(round(x)) else: print("NO") else: print("NO")