#include <bits/stdc++.h>
using namespace std;
int a[200];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", a + i);
  bool flag = 0;
  for (int i = 2; i <= n; ++i)
    if (fabs(a[i] - a[i - 1]) >= 2) flag = 1;
  if (flag)
    puts("NO");
  else
    puts("YES");
}
