n=int(input()) sum=0 i=0 while True: i+=1 sum+=i if sum==n: print('YES') print(i) break elif sum>n: print('NO') break elif sum>10**10: print('NO')