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, ref int [] B, int n) {
    int s = n * (n+1) / 2;
    if (A.sum % s != 0)
        return false;
    int m = A.sum / s;
    int x = 0;
    foreach (i; 0..n) {
        if ((m + B[i]) % n != 0)
            return false;
        x += (m + B[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];
    }

    writeln(ok(A, B, N) ? "YES" : "NO");
}
