#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = double;
using pll = pair<ll, ll>;
using vll = vector<ll>;
using vpll = vector<pll>;
using vvll = vector<vll>;
ll N;
vll V, cor, rav;
int main() {
  ios::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  cin >> N;
  ll a;
  for (ll i = 0; i < (ll)N; ++i) cin >> a, V.push_back(a);
  bool ok = 1;
  for (ll i = 0; i < (ll)N - 1; ++i)
    if (abs(V[i + 1] - V[i]) > 1) ok = 0;
  if (ok)
    cout << "YES";
  else
    cout << "NO";
  cout << endl;
  return 0;
}
