#include <bits/stdc++.h>
using namespace std;

typedef long long int ll;

int main() {
    ll n;
    cin >> n;
    vector<ll> v(n);
    for (auto& i : v) cin >> i;

    ll sum = 0;
    for (auto i : v) sum += i;

    if (sum % (n * (n + 1) / 2)) {
        cout << "NO" << endl;
        return 0;
    }

    ll k = sum / (n * (n + 1) / 2);
    for (int i = 0; i < n; i++) {
        ll d = v[(i+1)%n] - v[i] - k;
        if(d > 0 || (-d) % n) {
            cout << "NO" << endl;
            return 0;
        }
    }

    cout << "YES" << endl;

    return 0;
}
