


object Main2 extends App {

  var n = scala.io.StdIn.readLine.toInt
  val hArr = scala.io.StdIn.readLine.split(" ").map(_.toInt)

  def solve(): String = {
    for(i <- 0 until n - 2) {
      val diff1 = hArr(i+1) - hArr(i)
      val diff2 = hArr(i+2) - hArr(i)

      if(diff1 < -1 || diff2 < - 1) return "No"
    }
    "Yes"
  }
  println(solve)
}
