"use strict";
const input = require("fs").readFileSync("/dev/stdin", "utf8");

const inputs = input.split("\n");
const arr = inputs[1].split(" ").map(Number);

const main = arr => {
  let max = 0;
  for (let i = 0; i < arr.length; i++) {
    if (max < arr[i]) {
      max = arr[i];
    }
    if (max - arr[i] > 1) {
      return "No";
    }
  }
  return "Yes";
};

console.log(main(arr));