#include <cstdio>
#define repi(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)

constexpr int MAX_N = 100000;

using ll = long long;

ll N;
ll A[MAX_N];
ll d[MAX_N], S;

int main()
{
  scanf( "%lld", &N );
  rep( i, N )
    scanf( "%lld", A+i ), S += A[i];

  if( S % (N*(N+1)/2) )
  {
    puts("NO");
    
    return 0;
  }

  ll k = S / (N*(N+1)/2);

  rep( i, N-1 )
    d[i] = A[i+1]-A[i];

  bool fl = true;
  rep( i, N-1 )
  {
    fl &= d[i] <= k;
    fl &= (d[i]-k)%N == 0;
  }

  puts( fl ? "YES" : "NO" );

  return 0;
}