function Main(input) {
  input = input.split('\n')
  var N = parseInt(input[0])
  var H = input[1].split(' ').map(str => parseInt(str))
  var Max = 0
  var flag = false

  for (var i = 0; i < N; i++) {
    if (H[i] > H[i + 1]) {
      H[i]--
      if (Max < H[i]) {
        flag = true
        break
      }
    }
    Max = H[i]
  }

  console.log(flag ? 'No' : 'Yes')
}

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