#include <cstdio>
typedef long long lint;
int const N=1e5+10;
int n,a[N];
lint dif[N];
int main()
{
	freopen("b.in","r",stdin);
	scanf("%d",&n);
	if(n==1) {printf("YES"); return 0;}
	for(int i=1;i<=n;i++) scanf("%d",&a[i]);
	lint s=n*(n+1)>>1,sum=0;
	for(int i=1;i<=n;i++) sum+=a[i],dif[i]=a[i+1]-a[i];
	if(sum%s!=0) {printf("NO"); return 0;}
	lint k=sum/s,a1=0,sumX=0;
	for(int i=1;i<=n-1;i++)
	{
		lint x=(k-dif[i])/n;
		if(x*n!=k-dif[i]) {printf("NO"); return 0;}
		a1+=(n+1-i)*x; sumX+=x;
	}
	if(sumX>k || a1+(k-sumX)!=a[1]) {printf("NO"); return 0;}
	printf("YES");
	return 0;
}