input = require('fs').readFileSync(process.stdin.fd, 'utf8')
lines = input.split('\n')
N = lines.shift() * 1
H = lines.shift().split(' ')
max = 0
ans = 1
for (i=0; i<N; i++) {
    if (max <= H[i] * 1) {
        max = Math.max(H[i] - 1, max)
    } else {
        ans = 0
        break;
    }
}
console.log(['No', 'Yes'][ans])