local n = io.read("*n")
local t = {}
local sum = 0
for i = 1, n do
  t[i] = io.read("*n")
  sum = sum + t[i]
end
if (sum * 2) % (n * (n + 1)) ~= 0 then
  print("NO")
else
  local mul = (sum * 2) // (n * (n + 1))
  local isok = true
  local c = 0
  for i = 1, n do
    local sub = i == 1 and t[1] - t[n] or t[i] - t[i - 1]
    if (mul - sub) % n == 0 and 0 <= mul - sub then
      c = c + (mul - sub) // n
    else
      isok = false
      break
    end
  end
  isok = isok and c == mul
  print(isok and "YES" or "NO")
end
