import java.util.*

fun main(args: Array<String>){
	val cin = Scanner(System.`in`)
    val n = cin.nextInt()

    var sum: Long = 0
    val a: MutableList<Long> = mutableListOf()
    for (i in 1..n) {
        val ai = cin.nextLong()
        a.add(ai)
        sum += ai
    }

    var sum_one: Long = 0
    for (i in 1..n) {
        sum_one += i
    }
    
    var ok = 1
    var bye_n: Long = 0
    if (sum % sum_one == 0.toLong()) {
        bye_n = sum/sum_one
    } else {
        ok = 0
    }

    var real_bye_n: Long = 0

    val cuts: MutableList<Long> = mutableListOf()

    if (ok == 1) {
        for (i in 1..n) {
            var sub: Long
            if (i == n) {
                sub = a[0] - a[n-1]
            } else {
                sub = a[i] - a[i-1]
            }
            var cut: Long = bye_n - sub
            if (cut < 0) {
                ok = 0
                break
            }
            if (cut % n == 0.toLong()) {
                cut = cut/n
            } else {
                ok = 0
                break
            }
            real_bye_n += cut
            cuts.add(cut)
        }
    }

    if (ok == 1 && real_bye_n != bye_n) {
        ok = 0
    }

    if (ok == 1) {
        for (i in 1..n) {
            
        }
    }

    if (ok == 1) {
        println("YES")
    } else {
        println("NO")
    }
}