i=1 x=int(input()) count=0 while True: count+=i if count>x: print('NO') exit() if count==x: print('YES',i,sep='\n') i+=1