#include<bits/stdc++.h>

using namespace std;

int a[100010];
vector <int>b[100010];

int main()
{
	bool check1=true;
	int n;
	cin>>n;
	int maxx=0;
	for (int i=1;i<=n;i++) 
	{
		cin>>a[i];
		if (maxx-a[i]>1) check1=false;
		maxx=max(maxx,a[i]);
	}
	if (check1)cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
}