function main(input) {
    var args = input.trim().split("\n");
    var N = Number(args[0]);
    var Hs = args[1].split(" ").map(v => Number(v));

    for (var i = 0; N > i; i++) {
        if (i === 0) {
            Hs[i] = Hs[i] > 0 ? Hs[i] - 1 : Hs[i]
            continue;
        }

        if (Hs[i - 1] < Hs[i]) {
            Hs[i] = Hs[i] > 0 ? Hs[i] - 1 : Hs[i]
        } else if (Hs[i - 1] === Hs[i]) {
            continue;
        } else {
            console.log("No");
            return;
        }
    }

    console.log("Yes");
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));