"use strict"
function main(arg) {
    //最大は1000000
    var masuNum = parseInt(arg.trim().split("\n")[0]);
    var list = arg.trim().split("\n")[1].split(" ");

    var kotae = "Yes";

    if(masuNum != 1){
        for(var i = 0; i < masuNum ; i++){
            if(i + 1 != masuNum && i != 0){
            if(list[i] > list[i+1] || list[i] == list[i+1] && list[i-1] != list[i] ){
                list[i]--;
                if(list[i] < list[i +1] || list[i] == list[i +1]){
                    if(list[i-1] < list[i] || list[i-1] == list[i]){
                    }else{
                        kotae = "No";
                    }
                }else{
                    kotae = "No";
                }
            }
            }
            if(i == 0){
                list[i]--;
            }
        }
    }
    //console.log(list);
    console.log(kotae);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
