import std.stdio, std.math, std.algorithm, std.array, std.string, std.conv, std.container, std.range;
pragma(inline, true) T[] Reads(T)() { return readln.split.to!(T[]); }
alias reads = Reads!int;
pragma(inline, true) void scan(Args...)(ref Args args) {
    string[] ss = readln.split;
    foreach (i, ref arg ; args) arg = ss[i].parse!int;
}

void main() {
    int n; scan(n);
    int[] h = reads();

    bool can() {
        // dp[i][j] := i まで見たときの h の最大値
        // -1 は不可
        auto dp = new int[][](100010,2);
        foreach(i;0..100010) foreach(j;0..2) dp[i][j]=-1;

        dp[0][0] = dp[0][1] = 0;
        foreach (i; 1..n+1) {
            if (dp[i-1][0] >= 0) {
                dp[i][0] = max(dp[i-1][0], h[i-1]);
                dp[i][1] = max(dp[i-1][0], h[i-1] - 1);
            }
            if (dp[i-1][1] >= 0) {
                dp[i][0] = max(dp[i-1][1], h[i-1]);
                dp[i][1] = max(dp[i-1][1], h[i-1] - 1);
            }
            if (dp[i][0] > h[i-1])
                dp[i][0] = -1;
            if (dp[i][1] > h[i-1] - 1)
                dp[i][1] = -1;
        }
        return ~dp[n][0] || ~dp[n][1];
    }

    writeln(can() ? "Yes" : "No");
}