print_endline @@ Scanf.scanf "%d" @@ fun n ->
  let u = n * (n+1) / 2 in
  let a = Array.init n (fun _ -> Scanf.scanf " %d" ((+) 0)) in
  if n = 1 then "YES" else
  let s = Array.fold_left (+) 0 a in
  if s mod u <> 0 then "NO" else
  let m = s / u in
  let chk d =
    let k = max 0 ((d+n-2)/(n-1)) in
    let v = k*(n-1) - d in
    v <= m-k && (m-k-v) mod n = 0
  in
  let ok =
    Array.init n (fun i -> chk (a.(i) - a.((i+1) mod n)))
    |> Array.fold_left (&&) true
  in if ok then "YES" else "NO"