#include <bits/stdc++.h>
using namespace std;
int a[100005];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int f = 1;
  for (int i = 0; i < n - 1; i++) {
    if (abs(a[i + 1] - a[i]) > 1) {
      f = 0;
      break;
    }
  }
  if (f)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
