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 prev = Math.MAX_VALUE;
for (var i = 0; i < total; i++) {
  if (prev > nums[i] + 1) {
    can = false;
    break;
  }
  prev = nums[i];
}

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