fun main(args : Array<String>) {
    val N = readLine()!!.toInt()
    val H = readLine()!!.split(" ").map { it.toInt() }.toIntArray()


    H[0]--
    (1 until N).forEach {i ->
        val previous = H[i-1]
        val current = H[i]
        if (previous > current) {
            println("No")
            return
        }

        // If possible, decrement it
        if (previous < current) {
            H[i]--
        }

    }

    println("Yes")
}