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

  if (N === 1) {
    console.log('Yes')
    return
  }

  if (N === 2) {
    console.log(H[0] < H[1] ? 'Yes' : 'No')
    return
  }

  for (var i = 1; i <= N; i++) {
    if (H[i - 1] - H[i + 1] >= 2) {
      console.log('No')
      return
    }
  }
  console.log('Yes')
}

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