N = int(input()) A = int((2*N)**0.5) if A*(A+1)//2 == N: print('YES') print(A) else: print('NO')