'use strict';
function main(input) {
  const args = input.split('\n'),
        N = parseInt(args[0]),
        H = args[1].split(' ');
  for (let i = N-2; i >= 0; --i) {
    let difference = parseInt(H[i+1]) - parseInt(H[i]);
    if (difference === -1) {
      H[i] = (parseInt(H[i]) - 1).toString();
    } else if (difference < -1) {
      console.log('No');
      return;
    }
  }
  console.log('Yes');
}

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