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