import std.stdio, std.string, std.range, std.conv, std.array, std.algorithm, std.math, std.typecons;

void main() {
    const N = readln.chomp.to!long;
    auto Hs = readln.split.to!(long[]);
    foreach_reverse(i; 0..N-1) {
        if (Hs[i] > Hs[i+1]+1) {
            writeln("No");
            return;
        } else if (Hs[i] == Hs[i+1]+1) {
            Hs[i]--;
        }
    }
    writeln("Yes");
}

