N = int(eval(input()))

A = [int(a) for a in input().split()]



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

if sum(A) % RejectStones != 0: print("NO")

else:

    TotalOperation = sum(A) // RejectStones

    sumcheck = 0

    for i in range(N-1):

        if (TotalOperation - A[i+1] + A[i]) % N != 0 or TotalOperation < A[i+1] - A[i]:

            print("NO")

            break

        else:

            sumcheck += (TotalOperation - A[i+1] + A[i]) // N

    else:

        if (TotalOperation - A[0] + A[-1]) % N != 0 or TotalOperation < A[0] - A[-1]: print("NO")

        else: 

            sumcheck += (TotalOperation - A[0] + A[-1]) // N

            if sumcheck == TotalOperation: print("YES")

            else: print("NO")
import sys



def solve():

    input = sys.stdin.readline

    N = int(eval(input()))

    A = [int(a) for a in input().split()]

    totalA = sum(A)

    if totalA % (N * (N + 1) // 2) != 0: print("NO")

    else:

        Op = totalA // (N * (N + 1) // 2)

        subA = [A[(i + 1) % N] - A[i] for i in range(N)]

        count = 0

        for i, a in enumerate(subA):

            if (Op - a) % N != 0 or a > Op:

                print("NO")

                break

            else: count += (Op - a) // N

        else: 

            if count == Op: print("YES")

            else: print("NO")

    

    return 0



if __name__ == "__main__":

    solve()



N = int(eval(input()))
A = [int(a) for a in input().split()]
RejectStones = N * (N + 1) // 2
if sum(A) % RejectStones != 0:
    print("NO")
else:
    TotalOperation = sum(A) // RejectStones
    sumcheck = 0
    for i in range(N - 1):
        if (TotalOperation - A[i + 1] + A[i]) % N != 0 or TotalOperation < A[i + 1] - A[
            i
        ]:
            print("NO")
            break
        else:
            sumcheck += (TotalOperation - A[i + 1] + A[i]) // N
    else:
        if (TotalOperation - A[0] + A[-1]) % N != 0 or TotalOperation < A[0] - A[-1]:
            print("NO")
        else:
            sumcheck += (TotalOperation - A[0] + A[-1]) // N
            if sumcheck == TotalOperation:
                print("YES")
            else:
                print("NO")

import sys


def solve():
    input = sys.stdin.readline
    N = int(eval(input()))
    A = [int(a) for a in input().split()]
    totalA = sum(A)
    if totalA % (N * (N + 1) // 2) != 0:
        print("NO")
    else:
        Op = totalA // (N * (N + 1) // 2)
        subA = [A[(i + 1) % N] - A[i] for i in range(N)]
        count = 0
        for i, a in enumerate(subA):
            if (Op - a) % N != 0 or a > Op:
                print("NO")
                break
            else:
                count += (Op - a) // N
        else:
            if count == Op:
                print("YES")
            else:
                print("NO")
    return 0


if __name__ == "__main__":
    solve()

-N = int(eval(input())) -A = [int(a) for a in input().split()] -RejectStones = N * (N + 1) // 2 -if sum(A) % RejectStones != 0: -    print("NO") -else: -    TotalOperation = sum(A) // RejectStones -    sumcheck = 0 -    for i in range(N - 1): -        if (TotalOperation - A[i + 1] + A[i]) % N != 0 or TotalOperation < A[i + 1] - A[ -            i -        ]: -            print("NO") -            break +import sys + + +def solve(): +    input = sys.stdin.readline +    N = int(eval(input())) +    A = [int(a) for a in input().split()] +    totalA = sum(A) +    if totalA % (N * (N + 1) // 2) != 0: +        print("NO") +    else: +        Op = totalA // (N * (N + 1) // 2) +        subA = [A[(i + 1) % N] - A[i] for i in range(N)] +        count = 0 +        for i, a in enumerate(subA): +            if (Op - a) % N != 0 or a > Op: +                print("NO") +                break +            else: +                count += (Op - a) // N -            sumcheck += (TotalOperation - A[i + 1] + A[i]) // N -    else: -        if (TotalOperation - A[0] + A[-1]) % N != 0 or TotalOperation < A[0] - A[-1]: -            print("NO") -        else: -            sumcheck += (TotalOperation - A[0] + A[-1]) // N -            if sumcheck == TotalOperation: +            if count == Op: +    return 0 + + +if __name__ == "__main__": +    solve()