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;


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+1)%N] - A[i];
    }

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

    bool ans = false;
    foreach (m; min_n..(max_n+1)) {
        int x = 0;
        bool f = true;
        foreach (i; 0..N) {
            if ((m - B[i]) % N != 0) {
                f = false;
                break;
            }
            x += (m-B[i])/N;
        }

        if (!f) continue;
        if (x == m) {
            ans = true;
            break;
        }

    }
    writeln(ans ? "YES" : "NO");
}
