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