n=gets.to_i a=(0..(2e9.to_i)).bsearch{|x| x*(x+1)/2>=n} puts a*(a+1)/2==n ? "YES\n#{a}" : "NO"