import scala.io.StdIn.{readInt, readLine}
object Main extends App {
  val n = readInt
  val as = readLine.split(" ").map(_.toInt)

  val m = n * (n + 1) / 2
  if (as.sum % m != 0) println("NO")
  else {
    val bs = (as zip as.tail :+ as.head) map {
      case (a, b) => b - a
    }
    if (bs.sum == 0 && bs.filter(_ > 0).forall(_ == as.sum / m)) println("YES")
    else println("NO")
  }
}
