fn main() { let mut n = String::new(); std::io::stdin().read_line(&mut n).ok(); let n: usize = n.trim().parse().unwrap(); let mut a = String::new(); std::io::stdin().read_line(&mut a).ok(); let mut a: Vec = a.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let mut addval = 0usize; while let Some(x) = a.pop() { if (x + addval) % (a.len() + 1) > 0 { println!("No"); return; } addval += (x + addval) / (a.len() + 1); } println!("Yes"); }