function Main(input) {
  "use strict"
  const temp = input.split("\n")
  
	const n = parseInt(temp.shift());
  const hn = temp.shift().split(" ").map(e => parseInt(e));
  
  let flag = true;
  let maximum = 0;
  for(let i = 0; i < n; i++){
    if(hn[i] > maximum) maximum = hn[i]
    else if(maximum - hn[i] > 1){
      flag = false;
      break;
    }
  }
  const ans = (flag) ? "Yes" : "No";
  console.log(ans)
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
