#include <bits/stdc++.h>
using namespace std;

int main(){
  int n; cin>>n;
  int a,b; cin>>a;
  bool flg=true;

  --a;
  for(int i=0; i<n-1; ++i){
    cin>>b;
    if(a<b)a=b-1;
    else if(a==b)a=b;
    else{flg=false; break;}
  }

  if(flg)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}
