function Main(input) {
	input = input.split("\n");
	var stair_num = parseInt(input[0]);
	var stair_arr = input[1].split(" ").map( v => parseInt(v,10) ); 
	var lawest = 0;
  	for(var i=0; i<stair_num; i++){
      	if( stair_arr[i] < lawest ){ console.log("No"); return; }
      	if( stair_arr[i] > lawest ){
        	lawest = stair_arr[i]-1;
        }
    }
  
  	console.log("Yes");
}


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