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

  	//出力
	console.log(ans);
}

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