#include<bits/stdc++.h>
using namespace std;
using ll = int64_t;
int main(){
    ll N;
    cin >> N;
    ll a[N];
    ll po = N * (N + 1) / 2;
    ll sum = 0;
    bool ok = 1;
    for(ll i = 0; i < N; i++){
        cin >> a[i];
        sum += a[i];
    }
    ll sa;
    if(sum % po) ok = 0;
    ll kaisu = sum / po;
    ll yo = kaisu;
    for(ll i = 0; i < N; i++){
        sa = a[(i + 1) % N] - a[i] - kaisu;
        if(sa < 0){
            if(-sa % N) ok = 0;
            yo -= -sa / N;
        }
    }
    if(yo) ok = 0;
    cout << (ok ? "YES\n" : "NO\n");
    return 0;
}