#include <bits/stdc++.h>
using namespace std;
int a[15];
int main() {
  int n;
  cin >> n;
  int flag = 1;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (i != 1 && abs(a[i] - a[i - 1]) >= 2) {
      flag = 0;
      break;
    }
  }
  if (flag)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
