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