object Main {
  def main(args:Array[String]) {
    val N = readLine().toInt
    var H = readLine().split(' ').map(_.toInt)
 
    var flag = true
    for(i <- 0 until N - 1) if(H(i) > H(i + 1)) H(i) -= 1
    for(i <- 0 until N - 1) if(H(i) > H(i + 1)) flag = false
    if(flag) println("Yes")
    else println("No")
  }
}