#include <bits/stdc++.h>
typedef long long i64;
using std::cout;
using std::endl;
using std::cin;
 
int main(){
    i64 n, sum = 0; cin >> n;
    std::vector<int> a(n);
    for(int i = 0; i < n; i++) {
        cin >> a[i];
        sum += a[i];
    }

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

    for(int i = 0; i < n; i++) {
        i64 d = a[(i + 1) % n] - a[i] - sum;
        if(d % n or d > 0) {
            cout << "NO" << endl;
            return 0;
        }
    }

    cout << "YES" << endl;
    return 0;
}