import math n=int(input()) k=(-1+math.sqrt(1+8*n))/2 if k-int(k)==0: print('YES') print(int(k)) else: print('NO')