#include <bits/stdc++.h>
using namespace std;
long long n, i, a[107];
string s;
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) cin >> a[i];
  for (i = 1; i < n; i++) {
    if (abs(a[i] - a[i + 1]) >= 2) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
