#include <iostream>
#include <cstdio>
using namespace std;

int n, a[100005];
int main() {
	int i;
	cin>>n;
	for(i=1; i<=n; i++) scanf("%d", &a[i]);
	for(i=n-1; i>=1; i--) {
		if(a[i] > a[i+1]) {
			a[i]--;
			if(a[i] > a[i+1]) {cout<<"No"; return 0;}
		}
	}
	cout<<"Yes";
	return 0;
}
