#include "bits/stdc++.h"
using namespace std;
const int N=1e5+20;
int n,a[N];
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++) scanf("%d",&a[i]);

	for(int i=n;i>1;i--)
	{
		if(a[i]>=a[i-1]) continue;
		a[i-1]--;
		if(a[i]<a[i-1]) return 0 * printf("No");
	}
	printf("Yes");
}