import sys N = int(input()) # x(x+1)/2 = N # 4x^2+4x+1 = 8N+1 M = 8 * N + 1 sq = int(M**.5) while (sq+1)**2 <= M: sq += 1 if sq * sq == M: print('YES') print((sq-1)//2) else: print('NO')