#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int prec = -1;
  int actu;
  for (int i = 0; i < N; i++) {
    cin >> actu;
    if (i > 0) {
      if (abs(prec - actu) >= 2) {
        cout << "NO" << endl;
        exit(0);
      }
    }
    prec = actu;
  }
  cout << "YES" << endl;
}
