#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using uint = unsigned int;
const int NMax = 2e3 + 5;
const ll inf_ll = 1e18 + 5;
const int inf_int = 1e9 + 5;
const int mod = 1e9 + 7;
using zint = ll;
int dp[NMax][NMax];
int f(int i) { return i; }
int main() {
  cin.sync_with_stdio(false);
  cin.tie(0);
  int N;
  cin >> N;
  vector<int> v(N);
  for (auto& val : v) {
    cin >> val;
  }
  bool ans = true;
  for (int i = 0; i < v.size() - 1; ++i) {
    if (abs(v[i] - v[i + 1]) >= 2) {
      ans = false;
      goto after;
    }
  }
after:
  cout << (ans ? "YES" : "NO");
  return 0;
}
