#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int k;
  cin >> k;
  for (int i = 1; i < n; ++i) {
    int tmp;
    cin >> tmp;
    if ((k - tmp) * (k - tmp) > 1) {
      cout << "NO";
      return 0;
    }
    k = tmp;
  }
  cout << "YES";
  return 0;
}
