#include <iostream>
using namespace std;
int n;
int mx=-1;

int main()

{
	ios::sync_with_stdio(false);
	cin>>n;
	for (int i=1;i<=n;i++){
		int x;
		cin>>x;
		if (mx-x>=2){
			cout<<"No"<<endl;
			return 0;
		}
		mx=max(mx,x);
	}
	cout<<"Yes"<<endl;
	return 0;
}