#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  ll n,i;scanf("%lld",&n);
  ll a[n];
  for(i=0;i<n;i++) scanf("%lld",&a[i]);
  for(i=1;i<n;i++){
    if(a[i-1]>a[i]){
      printf("No\n");return 0;
    } else if(a[i-1]<a[i]) a[i]--;
  }
  printf("Yes\n");return 0;
}