#include<iostream>

using namespace std;
 
int main(){
	int n, a, b;
	bool p = true;
	
	cin >> n;
	
	cin >> a;
	for(int i = 1; i < n; i++){
		cin >> b;
		if(a > b) p = false;
		if(a < b) b--;
		a = b;
	}
	
	if(p) cout << "Yes" << endl;
	else cout << "No" << endl;
	
	return 0;
}