n=int(eval(input()))

lis=list(map(int,input().split()))

num=(n*(n+1))//2

ll=sum(lis)

if ll%num!=0:

  print("NO")

  exit()

ans=0

for i in range(n):

  if abs(lis[i]-lis[i-1]-ll//num)%n!=0:

    print("NO")

    exit()

  ans+=abs(lis[i]-lis[i-1]-ll//num)//n

if ans == ll//num:print("YES")

else:print("NO")

n = int(eval(input()))

lis = list(map(int,input().split()))

if sum(lis) % sum([i for i in range(1,n+1)]) != 0:

    print("NO")

    exit()

key = sum(lis) // sum([i for i in range(1,n+1)])

li = [-lis[i]+lis[i-1]+key for i in range(n)]

for num in li:

    if num < 0 or num % n != 0:

        print("NO")

        exit()

print("YES")
n = int(eval(input()))
lis = list(map(int, input().split()))
num = (n * (n + 1)) // 2
ll = sum(lis)
if ll % num != 0:
    print("NO")
    exit()
ans = 0
for i in range(n):
    if abs(lis[i] - lis[i - 1] - ll // num) % n != 0:
        print("NO")
        exit()
    ans += abs(lis[i] - lis[i - 1] - ll // num) // n
if ans == ll // num:
    print("YES")
else:
    print("NO")

n = int(eval(input()))
lis = list(map(int, input().split()))
if sum(lis) % sum([i for i in range(1, n + 1)]) != 0:
    print("NO")
    exit()
key = sum(lis) // sum([i for i in range(1, n + 1)])
li = [-lis[i] + lis[i - 1] + key for i in range(n)]
for num in li:
    if num < 0 or num % n != 0:
        print("NO")
        exit()
print("YES")

-num = (n * (n + 1)) // 2 -ll = sum(lis) -if ll % num != 0: +if sum(lis) % sum([i for i in range(1, n + 1)]) != 0: -ans = 0 -for i in range(n): -    if abs(lis[i] - lis[i - 1] - ll // num) % n != 0: +key = sum(lis) // sum([i for i in range(1, n + 1)]) +li = [-lis[i] + lis[i - 1] + key for i in range(n)] +for num in li: +    if num < 0 or num % n != 0: -    ans += abs(lis[i] - lis[i - 1] - ll // num) // n -if ans == ll // num: -    print("YES") -else: -    print("NO") +print("YES")