import sys

input = sys.stdin.readline

sys.setrecursionlimit(100000)



def getN():

    return int(eval(input()))

def getList():

    return list(map(int, input().split()))

import math



n = getN()

nums = getList()

if sum(nums) % ((n * (n+1)) // 2) != 0:

    print("NO")

    sys.exit()

n_operate = sum(nums) // ((n * (n+1)) // 2)



v_valid = n_operate

v_sign = n



for i, j in zip(nums, nums[1:] + [nums[0]]):

    diff = j - i

    if diff > v_valid:

        print("NO")

        sys.exit()

    if (v_valid - diff) % v_sign != 0:

        print("NO")

        sys.exit()

    n_operate -= (v_valid - diff) // v_sign

    # print(n_operate)

if n_operate == 0:

    print("YES")

else:

    print("NO")

# print("YES")
import sys

# from collections import defaultdict, deque

# import math

# import copy

from bisect import bisect_left, bisect_right

# import heapq



# sys.setrecursionlimit(1000000)



# input aliases

input = sys.stdin.readline



getS = lambda: input().strip()

getN = lambda: int(eval(input()))

getList = lambda: list(map(int, input().split()))

getZList = lambda: [int(x) - 1 for x in input().split()]



INF = 10 ** 20

MOD = 1000000007



def solve():

    n = getN()

    nums = getList()



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

    ope = sum(nums) // bulk

    if sum(nums) % bulk != 0:

        print("NO")

        return

    nums = nums + [nums[0]]



    tmp = 0

    for i, j in zip(nums, nums[1:]):

        if j - i > ope:

            print("NO")

            return

        else:

            expected = i + ope

            if (expected - j) % n != 0:

                print("NO")

                return

            tmp += (expected - j) // n

    # print(tmp)

    if tmp == ope:

        print("YES")

    else:

        print("NO")





def main():

    n = getN()

    for _ in range(n):

        solve()

if __name__ == "__main__":

    # main()

    solve()

import sys

input = sys.stdin.readline
sys.setrecursionlimit(100000)


def getN():
    return int(eval(input()))


def getList():
    return list(map(int, input().split()))


import math

n = getN()
nums = getList()
if sum(nums) % ((n * (n + 1)) // 2) != 0:
    print("NO")
    sys.exit()
n_operate = sum(nums) // ((n * (n + 1)) // 2)
v_valid = n_operate
v_sign = n
for i, j in zip(nums, nums[1:] + [nums[0]]):
    diff = j - i
    if diff > v_valid:
        print("NO")
        sys.exit()
    if (v_valid - diff) % v_sign != 0:
        print("NO")
        sys.exit()
    n_operate -= (v_valid - diff) // v_sign
    # print(n_operate)
if n_operate == 0:
    print("YES")
else:
    print("NO")
# print("YES")

import sys

# from collections import defaultdict, deque
# import math
# import copy
from bisect import bisect_left, bisect_right

# import heapq
# sys.setrecursionlimit(1000000)
# input aliases
input = sys.stdin.readline
getS = lambda: input().strip()
getN = lambda: int(eval(input()))
getList = lambda: list(map(int, input().split()))
getZList = lambda: [int(x) - 1 for x in input().split()]
INF = 10**20
MOD = 1000000007


def solve():
    n = getN()
    nums = getList()
    bulk = n * (n + 1) // 2
    ope = sum(nums) // bulk
    if sum(nums) % bulk != 0:
        print("NO")
        return
    nums = nums + [nums[0]]
    tmp = 0
    for i, j in zip(nums, nums[1:]):
        if j - i > ope:
            print("NO")
            return
        else:
            expected = i + ope
            if (expected - j) % n != 0:
                print("NO")
                return
            tmp += (expected - j) // n
    # print(tmp)
    if tmp == ope:
        print("YES")
    else:
        print("NO")


def main():
    n = getN()
    for _ in range(n):
        solve()


if __name__ == "__main__":
    # main()
    solve()

+# from collections import defaultdict, deque +# import math +# import copy +from bisect import bisect_left, bisect_right + +# import heapq +# sys.setrecursionlimit(1000000) +# input aliases -sys.setrecursionlimit(100000) +getS = lambda: input().strip() +getN = lambda: int(eval(input())) +getList = lambda: list(map(int, input().split())) +getZList = lambda: [int(x) - 1 for x in input().split()] +INF = 10**20 +MOD = 1000000007 -def getN(): -    return int(eval(input())) +def solve(): +    n = getN() +    nums = getList() +    bulk = n * (n + 1) // 2 +    ope = sum(nums) // bulk +    if sum(nums) % bulk != 0: +        print("NO") +        return +    nums = nums + [nums[0]] +    tmp = 0 +    for i, j in zip(nums, nums[1:]): +        if j - i > ope: +            print("NO") +            return +        else: +            expected = i + ope +            if (expected - j) % n != 0: +                print("NO") +                return +            tmp += (expected - j) // n +    # print(tmp) +    if tmp == ope: +        print("YES") +    else: +        print("NO") -def getList(): -    return list(map(int, input().split())) +def main(): +    n = getN() +    for _ in range(n): +        solve() -import math - -n = getN() -nums = getList() -if sum(nums) % ((n * (n + 1)) // 2) != 0: -    print("NO") -    sys.exit() -n_operate = sum(nums) // ((n * (n + 1)) // 2) -v_valid = n_operate -v_sign = n -for i, j in zip(nums, nums[1:] + [nums[0]]): -    diff = j - i -    if diff > v_valid: -        print("NO") -        sys.exit() -    if (v_valid - diff) % v_sign != 0: -        print("NO") -        sys.exit() -    n_operate -= (v_valid - diff) // v_sign -    # print(n_operate) -if n_operate == 0: -    print("YES") -else: -    print("NO") -# print("YES") +if __name__ == "__main__": +    # main() +    solve()