import sys import math n = int(input()) triangular = math.sqrt(8 * n + 1) if triangular.is_integer(): print(f"YES\n{(int(triangular)-1)//2}") else: print("NO")