var input = require("fs").readFileSync("/dev/stdin", "utf8").split("\n");
var total = parseInt(input[0], 10);
var nums = input[1].split(" ").map(function(num) {
  return parseInt(num, 10);
});

var can = true;

var current = nums[total - 1];
for (var i = total - 1; i >= 0; i--) {
  var prev = nums[i - 1];
  if (typeof prev === 'undefined') {
    continue;
  }
  if (prev <= current) {
    current = prev;
    continue;
  }

  if (prev - 1 <= current) {
    current = prev - 1;
    continue;
  }

  can = false;
  break;
}

console.log(can ? 'Yes' : 'No');


