#include <bits/stdc++.h>
using namespace std;
long long n,i,a[100000];
int main(){
  for(cin>>n>>a[0],i=1;i<n;i++){
    cin>>a[i];
    if(a[i]>a[i-1])a[i]--;
    else if(a[i]==a[i-1])continue;
    else if(a[i]<a[i-1])return cout<<"No",0;
  }
  cout<<"Yes";
}