#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long OO = (long long)1e18;
const int dx[] = {0, 1, -1, 0, 1, -1, 1, -1};
const int dy[] = {1, 0, 0, -1, 1, -1, -1, 1};
long long gcd(long long a, long long b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
long long fast_power(double base, long long power) {
  if (power == 1) return base;
  if (power % 2 == 0)
    return fast_power((base * base), power / 2);
  else
    return (base * fast_power((base * base), power / 2));
}
void Qalbaz() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(5);
}
vector<int> vec;
int front(int x) {
  int ans = 0, prev = vec[x];
  for (int i = x + 1; i < vec.size(); i++)
    if (vec[i] <= prev)
      ans++, prev = vec[i];
    else
      break;
  return ans;
}
int back(int x) {
  int ans = 0, prev = vec[x];
  for (int i = x - 1; i >= 0; i--)
    if (vec[i] <= prev)
      ans++, prev = vec[i];
    else
      break;
  return ans;
}
int main() {
  Qalbaz();
  int n;
  cin >> n;
  vec.resize(n);
  for (int i = 0; i < n; i++) cin >> vec[i];
  for (int i = 1; i < n; i++) {
    if (abs(vec[i] - vec[i - 1]) > 1) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES";
  return 0;
}
