import java.util.Scanner

/**
 * Created by sonetsuyoshi on 2015/12/16.
 */

object Main extends App {
  val sc = new Scanner(System.in)
  val n = sc.nextInt
  val a = Array.fill(n)(sc.nextLong)

  run()

  def run(): Unit = {
    val s = a.sum
    val c = n.toLong * (n + 1) / 2

    if(s % c != 0) {
      println("NO")
      return
    }

    val k = s / c

    val d = for(i <- 0 until n) yield a((i + 1) % n) - a(i)

    if(d.exists(x => x > k || (k - x) % n != 0)) println("NO")
    else println("YES")
  }
}