n,*a=list(map(int,open(0).read().split()))

b,m=sum(a),n*-~n//2

n-=1

c=b//m

f=b%m>0

for i,j in zip(*[iter([a[-1]]+a*2)]*2):

  j-=i

  if n:

    t=min(0,j//n)

    f|=c!=j+n*-t-t

print(('YNEOS'[f::2]))
n,*a=list(map(int,open(0).read().split()))

q,m=divmod(sum(a),n*-~n//2)

print(('YNEOS'[any((y-x-q)%n+m or y-x>q for x,y in zip(a,a[1:]))::2]))
n, *a = list(map(int, open(0).read().split()))
b, m = sum(a), n * -~n // 2
n -= 1
c = b // m
f = b % m > 0
for i, j in zip(*[iter([a[-1]] + a * 2)] * 2):
    j -= i
    if n:
        t = min(0, j // n)
        f |= c != j + n * -t - t
print(("YNEOS"[f::2]))

n, *a = list(map(int, open(0).read().split()))
q, m = divmod(sum(a), n * -~n // 2)
print(("YNEOS"[any((y - x - q) % n + m or y - x > q for x, y in zip(a, a[1:])) :: 2]))

-b, m = sum(a), n * -~n // 2 -n -= 1 -c = b // m -f = b % m > 0 -for i, j in zip(*[iter([a[-1]] + a * 2)] * 2): -    j -= i -    if n: -        t = min(0, j // n) -        f |= c != j + n * -t - t -print(("YNEOS"[f::2])) +q, m = divmod(sum(a), n * -~n // 2) +print(("YNEOS"[any((y - x - q) % n + m or y - x > q for x, y in zip(a, a[1:])) :: 2]))