#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
const double eps = 1e-9;
const int inf = 1e9;
int a[N];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  bool ok = 1;
  for (int i = 2; i <= n; i++)
    if (abs(a[i] - a[i - 1]) > 1) ok = 0;
  if (ok)
    cout << "YES";
  else
    cout << "NO";
}
