#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int arr[10], left[10], right[10];
  cin >> n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  bool ans = true;
  for (int i = 0; i < n; i++) {
    left[i] = -1;
    for (int j = i - 1; j >= 0; j--) {
      if (arr[j] < arr[i]) {
        left[i] = arr[i] - arr[j];
        break;
      }
    }
    right[i] = -1;
    for (int j = i + 1; j < n; j++) {
      if (arr[j] < arr[i]) {
        right[i] = arr[i] - arr[j];
        break;
      }
    }
  }
  for (int i = 0; i < n; i++)
    if (left[i] >= 2 || right[i] >= 2) ans = false;
  if (ans)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
