#include <bits/stdc++.h>
using namespace std;
void Solve() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  int diff = 0;
  for (int i = 1; i < n; i++) {
    diff = max(diff, abs(v[i] - v[i - 1]));
  }
  if (diff > 1)
    cout << "NO\n";
  else
    cout << "YES\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int q = 1;
  while (q--) {
    Solve();
  }
}
