import math N = int(input()) A = round(math.sqrt(1 + 8 * N)) print('YES\n%d' %((A-1)//2) if A**2 == 1 + 8 * N else 'NO')