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