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 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'
  }
}

console.log(answer)
