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))

var answer = 'Yes'
var mi = 0 // index of max value
for(var i in hList) {
  if(hList[mi] <= hList[i]) {
    mi = i
  }

  if(hList[mi] - hList[i] >= 2) {
    answer = 'No'
  }
}

console.log(answer)
