n = int(input()) k = int((n*2)**.5) print('YES\n' + str(k) if k*(k+1)//2 == n else 'NO')