#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
int a[100005],dis[100005],y[100005];
int main(){
	int n,i;
	scanf("%d",&n);
	ll sum=0;
	for(i=1;i<=n;i++)scanf("%d",&a[i]),sum+=a[i];
	if(sum%(n*(n+1)/2)){
		printf("NO\n");
		return 0;
	}
	sum/=(n*(n+1))/2;
	dis[1]=a[1]-a[n];
	for(i=2;i<=n;i++)dis[i]=a[i]-a[i-1];
	ll cnt=0;
	for(i=1;i<=n;i++){
		if((sum-dis[i]<0)||(sum-dis[i])%n){
			printf("NO\n"); 
			return 0;
		}
		else cnt+=(sum-dis[i])/n;
	}
	if(cnt!=sum)printf("NO\n");
	else printf("YES\n");
	return 0;
}