#include<bits/stdc++.h>
using namespace std;
int h[100100],n;
int main(){	
	scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%d",&h[i]);
	h[n+1]=2100000000;
	int maxx=-1;
	for(int i=1;i<=n;i++){
		maxx=max(maxx,h[i]);
		if(maxx-h[i]>1){
			printf("No");
			return 0;
		}
	}
	printf("Yes");
	return 0;
}