function f(inp) {
    inp = inp.split("\n");
    var N = +inp[0];
    var H = inp[1].split(" ").map(s => +s);
    var lf = H[0];
    for (var i = 1; i < N; i++) {
        var x = H[i];
        if (lf < x) {
            H[i]--;
        }
        else if (lf > x) {
            console.log("No")
            return;
        }
        lf = x;
    }
    console.log("Yes")
}
f(require("fs").readFileSync("/dev/stdin", "utf8"));