#include <bits/stdc++.h>
void File_IO() {}
using namespace std;
int main() {
  File_IO();
  int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if ((arr[i - 1] - arr[i]) >= 2 && i >= 1) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
}
