function Main(input) {
	input = input.split("\n");
	const N = parseInt(input[0])
	const Hs = input[1].split(" ").map(x => parseInt(x))

	var isPossible = true

	for(i=0; i < N; i++){
		if(i == 0){
			Hs[i] = Hs[i] - 1
		}else if(Hs[i] >= Hs[i+1]){
			if(Hs[i] - Hs[i+1] >= 2){
				isPossible = false
				break
			}else if(Hs[i-1] == Hs[i]){
				if(Hs[i] - Hs[i+1] == 1){
					isPossible = false
					break
				}
			}else{
				Hs[i] = Hs[i] - 1
			}
		}
	}

	if(isPossible){
		console.log("Yes")
	}else{
		console.log("No")
	}
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));