#include <bits/stdc++.h>
using namespace std;
int read() {
  char c = getchar();
  int f = 1, sum = 0;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    sum = sum * 10 + c - '0';
    c = getchar();
  }
  return sum * f;
}
int n, a[15];
int main() {
  n = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  for (int i = 1; i < n; i++)
    if (abs(a[i] - a[i + 1]) >= 2) {
      puts("NO");
      return 0;
    }
  puts("YES");
}
