#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;
long long n, a[100000], b;
int main() {
	cin >> n; for (int i = 0; i < n; i++) { cin >> a[i]; b += a[i]; }
	if (b % (n*(n + 1) / 2) != 0) { cout << "NO" << endl; return 0; }
	long long c = (b / (n*(n + 1) / 2));
	for (int i = 0; i < n; i++) {
		long long s = a[(i + 1) % n] - a[i];
		s *= -1; s += c;
		if (s < 0 || (s%n) != 0) { cout << "NO" << endl; return 0; }
	}
	cout << "YES" << endl;
	return 0;
}