#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
void yes() {
  cout << "Yes"
       << "\n";
}
void no() {
  cout << "No"
       << "\n";
}
struct Sync_stdio {
  Sync_stdio() {
    cin.tie(NULL);
    ios_base::sync_with_stdio(false);
  }
} _sync_stdio;
struct FAIL {
  FAIL() {
    cout << "CHANGE!!!"
         << "\n";
  }
};
bool check(const vector<int> &v) {
  int n = v.size();
  for (int i = (0); i < (n - 1); ++i) {
    if (abs(v[i] - v[i + 1]) >= 2) {
      cout << "NO";
      exit(0);
    }
  }
}
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int __i = 0; __i < (n); ++__i) cin >> v[__i];
  ;
  check(v);
  cout << "YES";
}
