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