import scala.io.StdIn

object Main extends App {
  val n  = StdIn.readLine().toInt
  val a: Array[Int]  = StdIn.readLine().split(" ").map(_.toInt)

  def solve(a: Array[Int]): String = {

    a.foldLeft(0) { (acc, i) =>
      if (acc < i) i - 1 else if (acc == i) i else return "No"
    }
    "Yes"
  }

  println(solve(a))
}
  

