import java.util.Scanner

import IsLowerd._

import scala.annotation.tailrec

object Main extends App {

  val sc = new Scanner(System.in)

  val n = sc.nextInt
  val hs = Vector.fill(n)(sc.nextInt)

  // 左から(昇順)見ると、-1する要素の左右を見ないといけないため、
  // exe: Seq(2, 2, 2, 1 )
  // 右から(降順)見る。 => Vector


  @tailrec
  def loop(vec: Vector[Int], right: Int, canLower: IsLowerd = CanLower): Boolean = {
    if(vec.isEmpty) true
    else {
      val left = vec.last
      (right - left, canLower) match {
        case ( d,          _) if d <= -2 => false
        case (-1, HaveLowerd)            => false
        case (-1,   CanLower)            => loop(vec.init, left - 1, HaveLowerd)
        case (_,       state)            => loop(vec.init, left, state)
      }
    }
  }

  val res = if(loop(hs.init, hs.last)) "Yes" else "No"

  println(res)

}

sealed trait IsLowerd

object IsLowerd {
  case object CanLower extends IsLowerd
  case object HaveLowerd extends IsLowerd
}