import java.util.*

fun main(args: Array<String>) {
  val sc = Scanner(System.`in`)
  val n = sc.nextInt()
  val h = (1..n).map { sc.nextInt() }.toIntArray()

  val bool = BooleanArray(n) { false }

  val hh = IntArray(n) { h[it] }
  for (i in 0 until n - 1) {
    if (hh[i] > hh[i + 1]) {
      hh[i] = hh[i] - 1
      bool[i] = true
    }
  }
  for (i in n - 2 downTo 0) {
    if (hh[i] > hh[i + 1]) {
      if (bool[i]) continue
      hh[i] = hh[i] - 1
      bool[i] = true
    }
  }

  for (i in 0 until n - 1) {
    if (hh[i] > hh[i + 1]) {
      println("No")
      return
    }
  }

  println("Yes")
}