#include <bits/stdc++.h>
using namespace std;
int a[12];
int main() {
  int n, f = 1, i;
  cin >> n;
  for (i = 0; i < n; ++i) cin >> a[i];
  for (i = 0; i < n - 1; ++i)
    if (((int)(abs(a[i] - a[i + 1]))) >= 2) f = 0;
  if (f)
    cout << "YES\n";
  else
    cout << "NO\n";
}
