#include <map>
#include <set>
#include <cmath>
#include <queue>
#include <stack>
#include <vector>
#include <cstdio>
#include <string>
#include <cstring>
#include <climits>
#include <cstdlib>
#include <iostream>
#include <algorithm>
using namespace std;
#define Mem(a) memset(a,0,sizeof(a))
#define mem(a) memset(a,-1,sizeof(a))
#define For(i,l,r) for(int (i)=(int)(l);(i)<(int)(r);++(i))
#define FOR(i,l,r) for(int (i)=(int)(l);(i)<=(int)(r);++(i))
#define rof(i,l,r) for(int (i)=(int)(l);(i)>=(int)(r);--(i))
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
typedef pair<int,int> pii;
typedef vector<pii> vpii;
typedef vector<int> vi;
typedef unsigned long long llu;
typedef long long ll;
const int mxn=1e5+3;
const int inf=INT_MAX;
ll a[mxn],n;
int main(){
	scanf("%lld",&n);
	ll sum=0;
	For(i,0,n){
		scanf("%lld",&a[i]);
		sum+=a[i];
	}
	ll tot=n*(n+1)/2;
	ll cnt=sum/tot;
	if(cnt*tot!=sum||(a[0]-a[n-1]-cnt)%n!=0){
		puts("NO");return 0;
	}
	For(i,1,n)if((a[i]-a[i-1]-cnt)%n!=0){
		puts("NO");return 0;
	}
	puts("YES");return 0;
}