import java.util.Scanner;

fun main (args : Array<String>) {
  val input = Scanner(System.`in`)
  
  while (input.hasNext()) {
    val N = input.nextInt()
    val H = IntArray(N)
    
    for (i in H.indices) {
      H[i] = input.nextInt()
    }
    
    for (i in H.lastIndex - 1 downTo 1) {
      if (H[i] > H[i - 1] || H[i] > H[i + 1] ) {
        --H[i]
      }
    }
    
    var isNonDecreasing = true
    for (i in 1..H.lastIndex) {
      if (H[i] < H[i - 1]) {
        isNonDecreasing = false
        break
      }
    }
    --H[0]
    
    if (isNonDecreasing) {
      println("Yes")
    } else {
      println("No")
    }
  }
}