#include <bits/stdc++.h>
using namespace std;
template <typename __T>
inline void read(__T &x) {
  x = 0;
  int f = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    x = x * 10 + c - '0';
    c = getchar();
  }
  x *= f;
}
int a[15];
int n;
int rabs(int x) { return x > 0 ? x : -x; }
int main() {
  read(n);
  for (int i = 1; i <= n; i++) read(a[i]);
  bool flag = 0;
  for (int i = 1; i < n; i++) flag |= (rabs(a[i] - a[i + 1]) >= 2);
  if (flag)
    printf("NO\n");
  else
    printf("YES\n");
  return 0;
}
