#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <iomanip>
#include <cassert>
#include <stack>
#include <queue>
#include <deque>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
//using namespace __gnu_pbds;

typedef long long ll;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;

// template<typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
//  order_of_key (k) : Number of items strictly smaller than k .
//  find_by_order(k) : K-th element in a set (counting from zero).
#define sz(a) (int)a.size()
#define all(a) a.begin(), a.end()
#define pb push_back
#define ppb pop_back
#define mkp make_pair
#define F first
#define S second
#define show(a) cerr << #a <<" -> "<< a <<"\n"
#define fo(a, b, c, d) for(int (a) = (b); (a) <= (c); (a) += (d))
#define foo(a, b, c ,d) for(int (a) = (b); (a) >= (c); (a) -= (d))
#define int ll

const int szT = (1 << 17) - 1;
const int oo = 1e9 + 5;

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

 main () {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int tt = 1;
	while (tt --) {
		solve();
	}
	return 0;
}
/*
	“I’m not gonna run away, I never go back on my word! That’s my nindo: my ninja way.” Naruto

__¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
_¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
¶¶¶¶¶¶¶¶¶¶¶¶¶_¶¶_¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
¶¶¶¶¶¶¶¶¶¶¶¶¶_¶¶__¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
¶¶¶¶¶¶¶¶¶¶¶¶¶_¶¶__¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
¶¶¶¶¶¶¶¶¶¶¶¶¶__¶¶¶¶_¶¶¶_¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______¶
¶¶¶¶¶¶¶¶¶¶¶¶¶__¶¶__¶¶¶¶¶_¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶_¶______
¶¶¶¶¶¶¶¶¶¶¶¶¶¶__¶¶¶¶¶_¶¶__¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶____¶¶_¶
¶¶¶¶¶¶¶¶¶¶¶¶¶¶_¶¶_¶_¶___¶__¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶_____¶_¶
¶¶¶¶¶¶¶¶¶¶¶¶¶¶__¶¶¶¶____¶¶_¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶__¶__¶_¶
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶__________¶__¶¶¶¶¶¶¶¶¶¶¶¶¶¶_____¶_¶
¶_¶¶¶¶¶¶¶__¶¶¶¶______________¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶____¶¶
__¶¶¶¶¶¶¶___¶¶¶_______________¶¶¶¶¶¶¶¶¶¶¶¶¶¶_¶_¶¶¶
__¶¶¶¶¶¶____¶¶¶_______________¶¶¶¶¶¶¶¶¶¶¶¶__¶_¶¶¶¶
__¶¶¶¶¶______¶¶________________¶¶¶¶¶¶¶¶¶¶¶_¶__¶¶¶¶
__¶¶¶¶_________________________¶¶¶¶¶¶¶¶¶¶¶___¶¶¶¶¶
__¶¶¶_____¶¶__________¶¶¶______¶¶_¶¶¶¶¶¶¶¶_¶¶¶¶¶¶¶
__¶¶¶¶¶¶¶_¶¶________¶¶¶¶_______¶¶_¶¶¶¶¶¶¶¶_¶¶¶¶¶¶¶
___¶¶¶¶¶¶¶______¶¶¶¶¶¶__________¶_¶¶¶¶¶¶¶___¶¶¶¶¶¶
___¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶______________¶¶¶_¶¶___¶¶¶¶¶¶
___¶¶¶¶¶¶¶¶¶¶¶¶¶_¶¶¶_______________¶¶¶_¶¶___¶¶¶¶¶¶
____¶¶¶¶¶¶¶¶¶¶____¶¶_______________¶¶__¶____¶_¶¶¶¶
_____¶¶¶¶¶¶¶¶¶__¶¶¶________________¶¶_¶_______¶¶¶¶
______¶¶¶¶¶¶¶¶¶¶___________________¶¶_________¶¶¶¶
_______¶¶¶¶¶¶¶¶¶______¶¶¶__________¶¶__________¶¶¶
________¶¶¶¶¶¶¶¶____¶¶¶¶___________¶_____________¶
________¶¶¶¶¶¶¶___¶¶___¶¶¶________¶¶_____________¶
__________¶¶¶__¶¶¶¶______¶¶______________________¶
___________¶¶_____________¶¶¶_________¶___________
___________¶¶_______________¶________¶¶___________
_____________________________¶_______¶____________

_______________________¶_________¶¶
________________¶_____¶_¶_______¶_¶
________¶______¶¶¶¶___¶__¶____¶¶__¶________¶¶
________¶¶¶¶¶__¶¶_¶__¶____¶_¶¶¶___¶¶____¶¶¶¶¶
________¶¶__¶¶¶¶___¶¶¶_____¶¶_____¶¶_¶¶¶¶__¶¶
_________¶_____¶____¶______________¶¶¶_____¶
__________¶________________________________¶
__¶¶¶_¶¶__¶¶______________________________¶¶
__¶¶¶__¶__________________________________¶¶¶¶
____¶¶_______________________________________¶¶¶¶¶
_____¶¶_________________________________________¶¶¶
_______¶¶________________________________¶¶__¶¶¶
___¶¶¶¶¶¶___________________________¶____¶¶¶¶
_¶¶¶_______________________¶¶¶¶¶___¶¶___¶¶¶¶¶
_¶¶___________________¶¶¶¶¶¶¶¶¶¶__¶¶¶___¶¶¶_¶¶
___¶¶¶____________¶¶¶¶¶¶¶¶¶¶_¶¶¶_¶¶¶¶¶_¶¶¶__¶¶¶
____¶¶______¶__¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶_¶¶¶¶_¶¶¶
__¶¶_______¶¶_¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶_¶¶¶__¶
_¶¶______¶¶¶_¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
_¶¶¶¶¶¶¶¶¶¶¶¶¶¶_¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
____¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
____¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶__¶_________¶¶¶¶¶¶¶
______¶¶¶¶¶¶¶¶_____¶¶¶¶_____¶________¶¶¶¶__¶
______¶¶¶¶________¶¶__¶¶___¶¶_________¶¶¶__¶
_______¶¶¶________¶_¶__¶¶__¶___________¶___¶
_______¶¶¶________¶_¶__¶¶_¶¶___¶¶¶¶¶¶_______¶
______¶¶¶¶________¶¶_¶¶¶¶¶¶_¶¶¶¶¶¶___________¶
______¶¶¶¶_________¶¶_¶__¶¶_______¶¶¶_________¶
______¶¶¶¶__________¶¶________¶¶¶¶_________¶¶¶
_____¶¶¶¶¶_________¶__¶¶¶_____¶___¶¶_______¶¶
_____¶¶¶¶¶¶______¶¶¶____¶¶_____¶¶¶_____¶¶¶¶¶
_____¶¶¶¶¶¶___¶¶¶¶¶¶_____¶¶___¶¶__________¶
____¶¶¶¶¶_¶__¶__¶_________¶¶_____________¶
____¶¶¶¶¶_¶¶¶¶¶¶¶¶¶¶¶_____________________¶
____¶¶¶¶¶_¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶_____________¶¶
___¶¶¶¶¶¶_¶¶_¶¶_¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶_¶¶¶¶¶¶
___¶¶¶¶¶¶_¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
___¶¶¶¶¶__¶¶¶¶¶_¶¶_¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
__¶¶¶_¶¶_¶¶¶¶¶¶¶¶¶__¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
__¶¶¶¶¶¶_¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
__¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
_¶¶¶¶¶¶¶¶¶_¶¶¶¶¶¶¶¶¶¶¶¶¶¶_¶¶¶¶¶¶¶¶¶¶
_¶¶¶¶¶¶¶¶_¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶_¶¶¶¶¶¶
¶¶¶¶¶¶¶¶_¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
___¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶
*/

Measured memory_bytes: 1792