const lineList = require('fs').readFileSync('/dev/stdin','utf8').trim().split('\n')
const n = parseInt(lineList[0])
const hList = lineList[1].split(' ').map(e => parseInt(e))

for(;;) {
  var mi = 0 // index of max value
  for(var i in hList) {
    if(hList[i] > hList[mi]) {
      mi = i
    }
  }

  var max = hList[mi]
  var answer = 'Yes'
  for(var i=mi;i<hList.length;i++) {
    if(max - hList[i] > 1) {
      answer = 'No'
    }
  }

  hList.splice(mi, 1)

  if(hList.length === 1) {
    break
  }
}

console.log(answer)
