fn main() { let mut n = String::new(); std::io::stdin().read_line(&mut n).ok(); let n: u64 = n.trim().parse().unwrap(); let k = (2. * n as f64).sqrt().floor() as u64; if k * (k + 1) == 2 * n { println!("YES"); println!("{k}"); } else { println!("NO"); } }