#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string ans="Yes";
  int N;
  cin >> N;
  int H1=0,H2;
  for(int i=0; i<N; i++){
    cin >> H2;
    if(H1>H2)ans="No";
    if(H1!=H2)H1=H2-1;
  }
  cout << ans << endl;
}