"use strict";
const main = arg => {
  let NumAmount = arg.split("\n")[0]*1;
  let row1 = arg.split("\n")[1].split(" ").map(x => x*1);
  let ans = "Yes";
  for(let i = 1; i < NumAmount; i++){
  	if(row1[i-1] < row1[i]){
    	continue;
    }else if( (row1[i-1] -1 <= row1[i]) && (row1[i] <= row1[i+1]) ){
		continue;
    } else {
    	ans = "No";
    }
  }
  console.log(ans);
}

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