'use strict';
const main = x => {
  const n = parseInt(x[0], 10);
  const h = x[1].split(' ').map(val => parseInt(val, 10));
  // console.log(n, h);
  let count = 0;
  let ans = 1;
  h[0]--;
  for(let i=0; i<n-1; i++) {
    if(h[i]<h[i+1])h[i+1]--;
    if(h[i]>h[i+1])return console.log("No");
  }
  return console.log("Yes");
  
};
main(require("fs").readFileSync("/dev/stdin", "utf8").split('\n'));