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