object Main {
  def main(args:Array[String]) {
    val N = scala.io.StdIn.readLine().toInt
    var A = scala.io.StdIn.readLine().split(' ').map(_.toLong)
    if (A.sum % (N*(N+1)/2) == 0) {
      val grad = A.sum / (N*(N+1)/2)
      A = A ++ Array(A(0))
      if ((A zip A.tail) forall { case (x,y) => y - x == grad || x > y })
        println("YES")
      else
        println("NO")
    }
    else println("NO")
  }
}
