object Main {
  def main(args:Array[String]) {
    val N = readLine().toInt
    var H = readLine().split(' ').map(_.toLong)

    var flag = true
    for(i <- (N - 1) until 0 by -1) if(H(i - 1) > H(i)) H(i - 1) -= 1
    for(i <- (N - 1) until 0 by -1) if(H(i - 1) > H(i)) flag = false
    if(flag) println("Yes")
    else println("No")
  }
}