import scala.io.StdIn._

object Main extends App {
  val N = readInt()
  val stairs = readLine(" ").split(" ").map(_.toInt).toSeq

  val res = for (e <- 0 until N - 1) yield {
    if (stairs(e + 1) - stairs(e) == -1) stairs(e) -1 else stairs(e)
  }

  if (res.equals(res.sortWith(_ < _))) println("Yes") else println("No")
}
