#include<bits/stdc++.h>
#define ll long long
using namespace std;
int n,a[100005],s[100005];
ll sum,turn;
bool flag=1;
inline int read(){
    int x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=(x<<3)+(x<<1)+ch-'0';ch=getchar();}
    return x*f;
}
int main(){
    n=read();
    for(int i=1;i<=n;++i) a[i]=read(),sum+=a[i];
    if(sum%(1ll*n*(n+1)/2)) return 0*puts("NO");
    ll turn=sum/(1ll*n*(n+1)/2);
    for(int i=1;i<=n;++i) s[i]=a[i%n+1]-a[i];
    for(int i=1;i<=n;++i) if(s[i]-turn>0||(-s[i]+turn)%n) flag=0;
    if(flag) puts("YES");
	else puts("NO");
}