N, *A = list(map(int, open(0).read().split()))

M = (N+1)*N//2

S = sum(A)

if S%M!=0:

  print('NO')

  import sys

  sys.exit()

cnt = S//M

x = 0

for i in range(N):

  df = A[(i+1)%N]-A[i]

  if (cnt-df)%N!=0 or cnt<df:

    print('NO')

    break

  x += (cnt-df)//N

else:

  if x==cnt:

    print('YES')

  else:

    print('NO')
N, *A = list(map(int, open(0).read().split()))

M = (N+1)*N//2

S = sum(A)

if S%M!=0:

  print('NO')

  exit()

cnt = S//M

for i in range(N):

  df = A[(i+1)%N]-A[i]

  if (cnt-df)%N!=0 or cnt<df:

    print('NO')

    break

else:

  print('YES')
N, *A = list(map(int, open(0).read().split()))
M = (N + 1) * N // 2
S = sum(A)
if S % M != 0:
    print("NO")
    import sys

    sys.exit()
cnt = S // M
x = 0
for i in range(N):
    df = A[(i + 1) % N] - A[i]
    if (cnt - df) % N != 0 or cnt < df:
        print("NO")
        break
    x += (cnt - df) // N
else:
    if x == cnt:
        print("YES")
    else:
        print("NO")

N, *A = list(map(int, open(0).read().split()))
M = (N + 1) * N // 2
S = sum(A)
if S % M != 0:
    print("NO")
    exit()
cnt = S // M
for i in range(N):
    df = A[(i + 1) % N] - A[i]
    if (cnt - df) % N != 0 or cnt < df:
        print("NO")
        break
else:
    print("YES")

-    import sys - -    sys.exit() +    exit() -x = 0 -    x += (cnt - df) // N -    if x == cnt: -        print("YES") -    else: -        print("NO") +    print("YES")