#include <bits/stdc++.h>

#define pb push_back
#define f first
#define s second

using namespace std;

const int N = 5e3 + 10;
const int md = 1e9 + 7;

int n;

int a[N];

long long sum;

int main() {
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
        scanf("%d", &a[i]);
        sum += a[i];
    }
    if (sum % (n * 1LL * (n + 1) / 2) != 0) return cout << "NO", 0;
    long long cycle = sum / (n * 1LL * (n + 1) / 2);
    for (int i = 1; i <= n; i++) {
        int nxt = (i + 1) % n;
        if (!nxt) nxt += n;
        if (cycle - (a[nxt] - a[i]) >= 0 && (cycle - (a[nxt] - a[i])) % n == 0)
            continue;
        else return cout << "NO", 0;
    }
    cout << "YES";
    return 0;
}

