import math N = int(input()) a = int(math.sqrt(2*N)) b = a + 1 if (a * b)//2 == N: print('YES') print(a) else: print('NO')