function p(s){
if(process.env.HOGE ){
  console.log(s);
}
}

function Main(args){

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

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

    p("index = "  + i + " : "  + row[i-1] + " vs " + row[i]);

    if( row[i-1] > row[i] ){

      // p( row[i-1] + "->" + String(row[i-1] - 1) );

      row[i-1] -= 1;

      // p("new value = " + row[i-1]);

    }

    if( row[i-1] > row[i] ){

      return console.log("No");
    }
  }

  p(row)
  console.log("Yes");
  p("===========")
}


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