#include<bits/stdc++.h>
using namespace std;
#define int long long
#define F first
#define ll long long 
#define S second
#define pb push_back
const int inf = 1000 * 1000 * 1000 + 1000;
const ll INF = 1LL * 1000 * 1000 * 1000 * 1000 * 1000 * 1000;

const int N = 1000 * 100 + 1000;
int a[N], d[N], x[N];

int32_t main(){
	ios::sync_with_stdio(false);cin.tie(0);

	int n, k, sum = 0, step;
	cin >> n;
	step = n * (n + 1) / 2;
	for(int i = 0; i < n; i++)
		cin >> a[i], sum += a[i];
	if(sum % step != 0){
		cout << "NO\n";
		return 0;
	}
	k = sum / step;
	for(int i = 0; i < n - 1; i++)
		d[i] = a[i + 1] - a[i];
	d[n - 1] = a[0] - a[n - 1];
	sum = 0;
	for(int i = 0; i < n; i++){
		int cnt = k - d[i];
		if(cnt % n != 0){
			cout << "NO\n";
			return 0;
		}
		x[i] = cnt / n;
		sum += x[i];
	}
	if(sum != k)
		cout << "NO\n";
	else
		cout << "YES\n";
	return 0;
}