use std::io::*; 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 n: u64 = itr.next().unwrap().parse().unwrap(); let mut l = 0; let mut r = 1u64 << 31; while r - l > 1 { let mid = (l + r) >> 1; if mid * (mid + 1) / 2 <= n { l = mid; } else { r = mid; } } if l * (l + 1) / 2 == n { println!("YES"); println!("{}", l); } else { println!("NO"); } }