q=(n=8*gets.to_i+1).sqrt if q**2!=n||q%2==0 puts :NO else puts :YES p q-1>>1 end