#include <bits/stdc++.h>
#define pb push_back

typedef long long ll;
using namespace std;

const ll MAXN = +100500;
const ll INF = 1e18;

ll a[MAXN];

int main() {
    ll n;
    cin >> n;
    ll sum = 0;
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
        sum += a[i];
    }
    ll mx = -INF;
    ll ind = -1;
    for (int i = 1; i <= n; i++) {
        if (a[i] > mx) {
            mx = a[i];
            ind = i;
        }
    }
    for (int j = 0; j < n; j++) {
        if (a[(ind + j) % n + 1] < j + 1) {
            cout << "NO";
            return 0;
        }
    }
    if (sum % ((n * n + n) / 2) != 0) cout << "NO";
    else cout << "YES";
}
