#include <iostream>
#include <cstdio>
#include <string>
#include <string.h>
#include <queue>
#include <math.h>
#include <cmath>
#include <map>
#include <set>
#include <vector>
#include <algorithm>
#include <bitset>
#include <list>
#include <ctype.h>
#include <cassert>
#include <stack>
#include <fstream>
#include <unordered_map>
#include <unordered_set>
#include <ctime>
#include <functional>
#include <ctime>
#include <limits>
#include <tuple>
#include <complex>
#include <numeric>
#include <future>

using namespace std;

#define snd second
#define fst first
#define mp make_pair
#define ll long long
#define ull unsigned long long
#define ld long double
#define pb push_back
#define left _left
#define right _right

const ld pi = acos(-1.0);

template<typename T>
T abs(T x) {
    return x > 0 ? x : -x;
}

template<typename T>
T sqr(T x) {
    return x * x;
}

template<typename T>
bool chmin(T &x, T y) {
    if (x > y) {
        x = y;
        return true;
    }
    return false;
}

template<typename T>
bool chmax(T &x, T y) {
    if (x < y) {
        x = y;
        return true;
    }
    return false;
}

template<typename U, typename V>
ostream &operator<<(ostream &s, const pair<U, V> &x) {
    s << "(" << x.fst << ", " << x.snd << ")";
    return s;
}

template<typename U>
ostream &operator<<(ostream &s, const vector<U> &x) {
    s << "[";
    bool was = false;
    for (auto it : x) {
        if (was) {
            s << ", ";
        }
        was = true;
        s << it;
    }
    s << "]";
    return s;
}

template<typename U>
ostream &operator<<(ostream &s, const set<U> &x) {
    s << "{";
    bool was = false;
    for (auto it : x) {
        if (was) {
            s << ", ";
        }
        was = true;
        s << it;
    }
    s << "}";
    return s;
}

template<int sz>
ostream operator<<(ostream &s, const bitset<sz> &x) {
    for (int i = 0; i < sz; i++) {
        s << x[i];
    }
    return s;
}


//--------------------------------------------------------------------------



int main() {
    srand(1231);


#ifdef LOCAL
	//gen();
	//return 0;
    freopen("a.in", "r", stdin);
    //freopen("a.out", "w", stdout);
#else
    //freopen(".in", "r", stdin);
    //freopen(".out", "w", stdout);
#endif

	//ofstream out("a.out");
	
	ll n;
	cin >> n;
	vector<ll> a(n);
	ll asum = 0;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		asum += a[i];
	}
	
	if (n == 1) {
		cout << "YES" << endl;
		return 0;
	}
	
	ll sum = n * (n + 1) / 2;
	
	if (asum % sum) {
		cout << "NO" << endl;
		return 0;
	}
	
	ll k = asum / sum;
	
	
	if (n == 2) {
		if (abs(a[0] - a[1]) <= k) {
			cout << "YES" << endl;
		} else {
			cout << "NO" << endl;
		}
		return 0;
	}
	
	
	vector<ll> b(n * 3);
	ll was = 0;
	for (int i = 0; i < n; i++) {
		ll x = a[i], y = a[(i + 1) % n];
		
		ll lo = -1, hi = k + 1;
		while (hi - lo > 1) {
			ll mid = (lo + hi) >> 1;
			
			//cout << mid << " " << (k - mid) - (n - 1) * mid << endl;
			if (y - x <= (k - mid) - (n - 1) * mid) {
				lo = mid;
			} else {
				hi = mid;
			}
		}
		
		//cout << y - x << " " << (k - lo) - (n - 1) * lo << endl;
		if (y - x != (k - lo) - (n - 1) * lo) {
			cout << "NO" << endl;
			return 0;
		}
		was += lo;
	}
	
	
	if (was == k) {
		cout << "YES" << endl;
	} else {
		cout << "NO" << endl;
	}
	
    return 0;
}


Measured memory_bytes: 3456