function Main(args){

  const firstRow = args.split("\n")[0];
  const row = args.split("\n")[1].split(" ");

  for(var i = row.length -2; i >= 0; i--){
    if(row[i] > row[i+1]) {
      row[i] = row[i] - 1;
    }
  }

  for(var i = 0; i < row.length -1  ;i++){
    if( row[i+1] < row[i] ){
      return console.log("No");
    }
  }

  console.log("Yes");

}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
