object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val stairCount: Int = sc.nextInt
  val stairs = List.fill(stairCount)(sc.nextInt).reverse

  def go(n: Int)(l: List[Int]): Boolean = l match {
    case Nil => true
    case _ if (l.filter(x => x > n + 1).isEmpty) => go(l.head)(l.tail)
    case _ => false
  }

  if (go(stairs.head)(stairs.tail)) println("Yes") else println("No")
}