function Main(args){

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

  for(var i = row.length -1; i > 0; i-- ){

    if( row[i-1] <= row[i] ){
      break;
    }
    // console.log( row[i-1] + "," + row[i] + ":" + String(row[i-1] > row[i]) );
    if( row[i-1] > row[i] ){
      row[i-1] -= 1;
    }
    if( row[i-1] > row[i] ){
      return console.log("No");
    }
  }

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



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