#include <bits/stdc++.h>
using namespace std;
int arr[10];
int n;
bool check() {
  for (int i = 0; i < n - 1; i++)
    if (arr[i] - arr[i + 1] > 1 || arr[i] - arr[i + 1] < -1) return false;
  return true;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  cout << (check() ? "YES" : "NO") << endl;
  return 0;
}
