#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, v[1000];
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", v + i);
  bool ok = 1;
  for (int i = 1; i < n; i++) ok &= abs(v[i] - v[i - 1]) <= 1;
  printf("%s\n", ok ? "YES" : "NO");
}
