const main = (inputs) => {
  var N = inputs[0].split(" ")[0]-0;
  var arr = inputs[1].split(" ").map(v=>v-0);
  var tmp = arr[0];
  var ans = true;
  arr.forEach(v=>{
    if(v+1<tmp) ans = false;
    tmp = Math.max(tmp, v);
  });
  console.log(ans?"Yes":"No");
}

main(require('fs').readFileSync('/dev/stdin', 'UTF-8').trim().split("\n"));
