'use strict';

function main(input) {
  const lines = input.split('\n');
  lines.pop();
    const n = parseInt(lines[0], 10);
    const array = lines[1];
    console.log(fn(n, array));
}

function fn(n, array) {
  const a = array.split(' ').map(v => parseInt(v, 10));
  let c = 0;
  let prev = -999;
  for(let c = 0; c < n; c++) {
    const current = a[c];
    if (c > 0) {
      prev = a[c - 1];
    }
    if (current - 1 >= prev) {
      a[c] = current - 1;
    }
    if (current < prev) {
      return 'No';
    }
  }
  return 'Yes';
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
