#include <bits/stdc++.h>
using namespace std;
int str[200];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> str[i];
  for (int i = 0; i < n - 1; ++i)
    if (str[i] - str[i + 1] >= 2) {
      puts("NO");
      return 0;
    }
  puts("YES");
  return 0;
}
