#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b, c, dif1, dif2, i;
  cin >> n;
  cin >> a >> b;
  for (i = 3; i <= n; i++) {
    cin >> c;
    dif1 = a - b;
    dif2 = b - c;
    if (dif1 < 0) dif1 = -dif1;
    if (dif2 < 0) dif2 = -dif2;
    if (dif1 >= 2 || dif2 >= 2) {
      cout << "NO" << '\n';
      return 0;
    }
    a = b;
    b = c;
  }
  cout << "YES" << '\n';
  return 0;
}
