#include <bits/stdc++.h>
using namespace std;
#define int long

signed main() {
	int n;
	cin >> n;
	int a[n];
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	long sum = accumulate(a, a + n, 0L);
	long div = n * (n + 1) / 2;
	if (sum % div) {
		cout << "NO\n";
		return 0;
	}
	long k = sum / div;
	long b[n];
	for (int i = 0; i < n; i++) {
		if (i != n - 1) b[i] = a[i + 1] - a[i] - k;
		else b[i] = a[0] - a[i] - k;
	}
	for (int i = 0; i < n; i++) {
		if (b[i] > 0 || b[i] % n) {
			cout << "NO\n";
			return 0;
		}
	}
	cout << "YES\n";
	return 0;
}
