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