#include <iostream>
using namespace std;
int main(){
  int n,h=0,next;
  cin>>n;
  bool flag=true;
  for(int i=0;i<n;i++){
    cin >> next;
    if( h > next)flag=false;
    else if(h < next)next--;
    h=next;
  }
  if(flag)cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}