'use strict'

const Main = (input) => {
  const tmp = input.trim().split('\n')
  const N = parseInt(tmp[0])
  const Harr = tmp[1].split(' ').map(Number)

  let result = 'Yes'

  for (let i = Harr.length - 1; i >= 1; i -= 1) {
    if (Harr[i] < Harr[i - 1]) {
      Harr[i - 1] -= 1
      if (Harr[i] < Harr[i - 1]) {
        result = 'No'
      }
    }
  }

  console.log(result)
  return result
}

Main(require('fs').readFileSync('/dev/stdin', 'utf8'))