import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, core.stdc.stdio, std.bitmanip;


bool ok(ref int[] A, int m, int n) {
    int x = 0;
    foreach (i; 0..n) {
        x += (m + A[i]) / n;
    }
    return x >= m;
}

bool ok2(ref int[] A, int m, int n) {
    int x = 0;
    foreach (i; 0..n) {
        if ((m + A[i]) % n != 0)
            return false;
        x += (m + A[i]) / n;
    }

    return x == m;
}

void main() {
    auto N = readln.chomp.to!int;
    auto A = readln.split.map!(to!int).array;
    auto B = new int[](N);
    foreach (i; 0..N) {
        B[i] = A[i] - A[(i+1)%N];
    }

    auto min_n = (A.reduce!(max) - 1) / N + 1;
    auto max_n = A.reduce!(min);

    int hi = max_n;
    int lo = min_n-1;
    while (hi - lo > 1) {
        int mid = (hi - lo) / 2 + lo;
        if (ok(B, mid, N)) {
            hi = mid;
        }
        else {
            lo = mid;
        }
    }
    writeln(ok2(B, hi, N) || ok2(B, lo, N) ? "YES" : "NO");
}
