#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b, f = 0;
  cin >> n;
  cin >> a;
  n--;
  while (n--) {
    cin >> b;
    if (abs(b - a) > 1) f = 1;
    a = b;
  }
  if (f)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;
}
