import kotlin.system.exitProcess

fun main(args: Array<String>) {
  readLine()
  val list = IO.readIntList().asReversed()
  var old = list[0]
  list.forEachIndexed { index: Int, value:Int ->
      if (index != 0) {
          var v = value
          if (v > old) v = v - 1
          if (v > old) {
              println("No")
              exitProcess(0)
          }
          old = v
      }
  }
    println("Yes")
}

object IO {
    fun readIntList(): List<Int> {
        return readLine()!!.split(" ").map(String::toInt)
    }
}