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

#define rep(i,n) for(int i=0;i<(n);++i)
#define reps(i,n) for(int i=1;i<=(n);++i)
#define repr(i,n) for(int i=(n);i>=0;--i)
#define cinv(n,v) VL v(n);rep(i,n)cin>>v[i]
#define itn int
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define all(h) h.begin(),h.end()
#define SORT(h) sort(all(h))
#define RSORT(h) sort(all(h),greater<>())
#define SZ(h) (signed)(h.size())
#define debg(h) cout<<#h<<" "<<h<<endl;
#define call(h) for(auto i:h)cout<<i<<" ";cout<<endl
#define callp(h) for(auto [k,v]:h)cout<<k<<":"<<v<<endl
#define show(h) for(cont &y:h){for(cont &x:y){cout<<x<<" ";}cout<<endl;}
#define out(h) cout<<(h)<<endl
#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define LINE puts("------------------")
#define fi first
#define se second
#define V vector
#define P pair
#define T tuple
#define PQ priority_queue
#define cont const auto
#define VV(type,name,y,x,h) vector<vector<type>> name = vector<vector<type>>(y,vector<type>(x,h))
typedef long long ll;
typedef double D;
typedef string str;
typedef vector<ll> VL;
typedef pair<ll,ll> PL;
typedef vector<pair<ll,ll>> VP;
typedef tuple<ll,ll,ll> T3;
typedef tuple<ll,ll,ll,ll> T4;
typedef struct{ll to;ll cost;} Graphs;
typedef V<V<Graphs>> AdjList;
const signed INF = (1LL<<30);
const long long MOD = (1e9+7);
const long long LINF = (1LL<<60);
const long long LMAX = LLONG_MAX;
void YN(bool b){cout<<(b?"Yes":"No")<<endl;}
template<class T>inline T gcd(T h,T b){if(b==0)return h; return(gcd(b,h%b));}
template<class T>inline T lcm(T h,T b){return h/gcd(h,b)*b;}
template<class T>inline bool chmax(T &h,const T &b){if(h<b){h=b;return true;}return false;}
template<class T>inline bool chmin(T &h,const T &b){if(h>b){h=b;return true;}return false;}
template<class T>T center(T h,T b,T c){
  if( (h<=b&&b<=c)||(h>=b&&b>=c) )return b;
  if( (b>=h&&h>=c)||(b<=h&&h<=c) )return h;
  return c;
}
inline void print(){cout<<endl;}
template<class Head,class... Tail>
inline void print(Head&& head, Tail&&... tail){
  cout<<head<<", ";
  print(forward<Tail>(tail)...);
}
inline void input(){}
template<class Head,class... Tail>
inline void input(Head&& head, Tail&&... tail){
  cin>>head;
  input(forward<Tail>(tail)...);
}
template<typename T>
inline ostream &operator<<(ostream&out,const vector<T>&v){
  if(!v.empty()){
    copy(v.begin(),v.end(),ostream_iterator<T>(out,", "));
    out<<"\b\b";
  }
  return out;
}
template<typename T1, typename T2>
inline ostream &operator<<(ostream&out,const pair<T1,T2>&p){
  out<<p.first<<", "<<p.second;
  return out;
}
template<typename T>
inline ostream &operator<<(ostream&out,const set<T>&st){
  for(const auto&elemnt:st)out<<elemnt<<", ";
  return out;
}
template<typename T1,typename T2>
inline ostream &operator<<(ostream&out,const vector<pair<T1,T2>>&vp){
  for(const auto &element:vp)
    out<<element.first<<", "<<element.second<<"\n";
  return out;
}
template<typename T>
inline istream &operator>>(istream&input,vector<T>&v){
  for(T&elemnt:v)input>>elemnt;
  return input;
}

signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout<<fixed<<setprecision(10);
  
  int n;
  cin>>n;
  vector<ll> h(n);
  rep(i,n)cin>>h[i];
  for(int i=n-1;i>0;--i)if(h[i]<h[i-1])h[i-1]--;
  rep(i,n-1){
    if(h[i]>h[i+1]){
      No;return 0;
    }
  }
  Yes;

  return 0;
}


Measured memory_bytes: 1024