import math import sys def solve_plus (a, b, c): return (-b + math.sqrt(b*b - 4*a*c)) / (2*a) def solve_minus (a, b, c): return (-b - math.sqrt(b*b - 4*a*c)) / (2*a) def check (n): return n == math.ceil(n) N = int(sys.stdin.readline()) result1 = solve_plus(1, 1, -2*N) result2 = solve_plus(1, 1, -2*N) if check(result1) or check(result2): print('YES') print( int(result1) if check(result1) else int(result2)) else: print('NO')