fn g() -> Vec { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); s.split_whitespace().flat_map(str::parse).collect() } fn main() { let n = g()[0]; let a = g(); let f = |x| ((x - a[0]) % n + n) % n < 1; println!("{}", if a.iter().all(f) { "Yes" } else { "No" }) }