use std::io::*; const EPS: f64 = 1e-10; fn main() { let mut s: String = String::new(); std::io::stdin().read_to_string(&mut s).ok(); let mut itr = s.trim().split_whitespace(); let m: u64 = itr.next().unwrap().parse().unwrap(); let n = m as f64; // x ^ 2 + x - n * 2 == 0 // x = (sqrt(8 * n + 1) - 1) / 2 let ans = ((n * 8.0 + 1.0).sqrt() - 1.0) / 2.0; if ans.fract() < EPS { if (ans.trunc() * (ans.trunc() + 1.0) / 2.0) as u64 == m { println!("YES"); println!("{}", ans.trunc()); } else { println!("NO"); } } else { println!("NO"); } }