output_description: If it is possible to remove all the stones from the boxes, print `YES`.
  Otherwise, print `NO`.
  
  * * *
input_description: The input is given from Standard Input in the following format:
  
      
      
      N
      A_1 A_2 … A_N
attempt: #n,a,b,c,d=map(int,input().split())
  n=int(input())
  a=[int(i) for i in input().split()]
  ans=False
  c=[]
  
  t=sum(a)//((n*(n+1))//2)
  
  if sum(a)%((n*(n+1))//2)!=0:
      ans=False
  else:
      for i in range(n):
          if i==0:
              d=a[0]-a[-1]
          else:
              d=a[i]-a[i-1]
          if (t-d)%n!=0:
              ans=False
              break
          s=(t-d)//n
          c.append(s)
      if sum(c)==t:
          #ans=True
  if n==1:
      ans=True
  print('YES' if ans else 'NO')
problem_description: Statement
  
  There are N boxes arranged in a circle. The i-th box contains A_i stones.
  
  Determine whether it is possible to remove all the stones from the boxes by
  repeatedly performing the following operation:
  
    * Select one box. Let the box be the i-th box. Then, for each j from 1 through N, remove exactly j stones from the (i+j)-th box. Here, the (N+k)-th box is identified with the k-th box.
  
  Note that the operation cannot be performed if there is a box that does not
  contain enough number of stones to be removed.
samples: [{"input": "5\n    4 5 1 2 3", "output": "YES\n    \n\nAll the stones can be removed in one operation by selecting the second box.\n\n* * *"}, {"input": "5\n    6 9 12 10 8", "output": "YES\n    \n\n* * *"}, {"input": "4\n    1 2 3 1", "output": "NO"}]