import std.stdio, std.conv, std.string, std.range, std.algorithm, std.range;

void main()
{
  auto N = readln.split[0].to!int;
  auto H = readln.split.to!(int[]);

  for(int i = N - 1; i > 0; i--) {
    if(H[i-1] > H[i]) H[i-1]--;
  }

  for (int i = 1; i < N; i++)
  {
    if (H[i - 1] > H[i])
    {
      writeln("No");
      return;
    }
  }
  writeln("Yes");
}
