function Main(input) {
  var len = parseInt(input.split("\n")[0]);
  var list = input.split("\n")[1].split(" ");
  if(len == 1){
     console.log("Yes");
    return;
  }else{
      for(var i = 0; i < list.length - 1; i++){
        var tmp1 = parseInt(list[i]);
        var tmp2 = parseInt(list[i + 1]);
        var tmp3 = tmp2 - 1;
        //console.log(tmp1 + "," + tmp2 + "," + tmp3);
        if(tmp1 == tmp2 || tmp1 <= tmp2 || tmp1 <= tmp3){
           
        }else{
           console.log("No");
        return;
        }
      }
    console.log("Yes");
  }
}

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