object Main extends App {
  import scala.io.StdIn._
  val n = readInt()
  val h = readLine().split(" ").map(_.toInt)
  var flag = false
  var big = h(0)
  for(i <- (1 until(n))){
    if(big > h(i) + 1) {
      flag = true
    }
    big = Math.max(big, h(i))
  }
  println(if(flag) "No" else "Yes")
}