#include "bits/stdc++.h"
using namespace std;
#define int long long
int mod=1e9+7;

signed main(){
  int n;
  cin>>n;
  vector<int> a(n);
  int sum=0;
  for(int i=0;i<n;i++){
    cin>>a[i];
    sum+=a[i];
  }
  int ka=n*(n+1)/2;
  if(sum%ka!=0){
    cout<<"NO"<<endl;
    return 0;
  }
  int x=sum/ka;
  vector<int> b(n);
  for(int i=0;i<n-1;i++){
    b[i]=a[i]-a[i+1]+x;
  }
  b[n-1]=a[n-1]-a[0]+x;
  bool f=true;
  for(int i=0;i<n;i++){
    //cout<<b[i]<<endl;
    if(b[i]<0||b[i]%n!=0)f=false;
  }
  if(f)cout<<"YES"<<endl;
  else cout<<"NO"<<endl;

}
