


object Main extends App {

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

  def solve(): String = {
    for(i <- 0 until n-1) {
      val diff = hArr(i+1) - hArr(i)
      diff match {
        case x if x >= 1 => hArr(i+1) -= 1
        case 0 => hArr(i+1)
        case _ => return "No"
      }
    }
    "Yes"
  }
  println(solve)
}
