

function Main(input) {
  input = input.split("\n");
  var N = parseInt(input[0]);
  var H = input[1].split(" ").map(i => parseInt(i));
  var H1=0;
  var ans="Yes";
  var max=0;
  for(var i=1;i<N;i++){
    if(H[i-1]-H[i]>2){
      ans="No";
      break;
    }else if(H[i-1]-H[i]==1){
      if(H[i-1]-1>=max){
        max=H[i-1]-1;
      }else{
        ans="No";
        break;
      }
    }
  }

  console.log('%s', ans);
  return ans;
}

function debug(n){
  var input = document.getElementById("input"+n).value;
  var ans=Main(input);
  var result="WA";
  if(ans==document.getElementById("output"+n).value.split("\n")[0]){
    result="AC";
  }
  document.getElementById("result"+n).innerHTML=result;
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));