#include <bits/stdc++.h>
using namespace std;
int main() {
  int arrSize;
  int ravArr[11];
  cin >> arrSize;
  for (int i = 1; i <= arrSize; i++) {
    scanf("%d", &ravArr[i]);
  }
  for (int i = 1; i < arrSize; i++) {
    if (abs(ravArr[i] - ravArr[i + 1]) >= 2) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << ("YES\n");
  return 0;
}
