#include <bits/stdc++.h>
using namespace std;
int n;
int seq[5010];
int seq2[5010];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &seq[i]);
  }
  for (int i = 1; i < n; i++)
    if (abs(seq[i] - seq[i - 1]) > 1) {
      puts("NO");
      return 0;
    }
  puts("YES");
  return 0;
}
