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