object Main {

  def main(args: Array[String]): Unit = {
    val n = io.StdIn.readLine().toInt
    val hList = io.StdIn.readLine().split(" ").map(_.toInt).toList
    val answer = solve(n, hList)
    println(answer)
  }

  private def solve(n: Int, hList: List[Int]): String = {

    def loop(_list: List[Int], before: Option[Int], operationCount: Int): String = {

      _list match {
        case h :: t =>
          before match {
            case Some(v) =>
              if (v - h > 1) "No"
              else if (v - h == 1 && (operationCount == 0)) loop(t, Some(h), operationCount + 1)
              else if (v - h == 1 && (operationCount > 0)) "No"
              else loop(t, Some(h), operationCount)
            case None => loop(t, Some(h), operationCount)
          }
        case _ => "Yes"
      }


    }

    loop(hList, None, 0)
  }
}
