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 = Seq.fill(n)(sc.nextInt)

  @tailrec
  def loop(list: Seq[Int], pre: Int, canLower: IsLowerd = CanLower): Boolean = {
    if(list.isEmpty) true
    else {
      (pre - list.head, canLower) match {
        case (d, _) if d >= 2 => false
        case (1, HaveLowerd)  => false
        case (1, CanLower)    => loop(list.tail, list.head, HaveLowerd)
        case (_, state)       => loop(list.tail, list.head, state)
      }
    }
  }

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

  println(res)

}

sealed trait IsLowerd

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