#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

int N;
ll a[100001];
ll d[100001];
ll sum;
ll sum_a;

int main() {
  cin >> N;

  for(int i = 0; i < N; i++) {
    cin >> a[i];
    sum_a += a[i];
  }

  for(int i = 1; i <= N; i++) {
    sum += i;
    d[i%N] = a[i%N] - a[i-1];
  }

  if(sum_a % sum != 0) {
    cout <<"NO"<<endl;
    return 0;
  }

  ll k = sum_a / sum;

  bool is = true;
  for(int i = 0; i < N; i++) {
    if(d[i] > k || (k-d[i]) % N != 0) {
      is = false;
      break;
    }
  }

  if(is) cout << "YES" <<endl;
  else cout << "NO" <<endl;
}
    
