"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const N = parseInt(arg[0]);
    const H = arg[1].split(" ").map(n=>parseInt(n)).reverse();
    
    for(let i=0; i<N-1; i++) {
        if(H[i] < H[i+1]) {
            H[i+1]--;
        }
    }
    
    H.reverse()
    
    for(let i=0; i<N-1; i++) {
        if(H[i] > H[i+1]) {
            console.log("No");
            return;
        }
    }
    
    console.log("Yes");
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));