import std;

alias sread = () => readln.chomp();
alias lread = () => readln.chomp.to!long();
alias aryread(T = long) = () => readln.split.to!(T[]);

void main()
{
    auto n = lread();
    auto h = aryread();
    long cnt;
    foreach (i; 0 .. n - 1)
    {
        if (h[i] < h[i + 1])
        {
            h[i + 1] -= 1;
        }
        // writeln(h);
    }
    foreach (i; 0 .. n - 1)
    {
        if (h[i] > h[i + 1])
        {
            writeln("No");
            return;
        }
    }
    writeln("Yes");
}

void scan(L...)(ref L A)
{
    auto l = readln.split;
    foreach (i, T; L)
    {
        A[i] = l[i].to!T;
    }
}
