#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k;
  int a[1000];
  int n;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (i = 0; i < n - 1; i++) {
    if (a[i + 1] - a[i] >= 2 || a[i] - a[i + 1] >= 2) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
}
