4
90 91 90 91
 4
54 54 54 55
 10
55 39 93 42 97 40 36 38 11 97
 3
90 39 98
 5
21 57 40 94 17
 8
46 4 30 85 52 6 84 13
 6
47 100 96 2 96 43
 4
61 28 3 81
 5
14 91 91 91 84
 3
22 23 24
 1
13
 9
13 80 13 38 98 85 11 73 74
 10
95 51 52 8 44 39 77 17 96 88
 3
40 40 40
 4
16 17 17 18
 3
68 67 67
 4
83 100 81 75
 9
71 71 70 70 71 70 69 70 71
 10
9 9 9 10 10 9 8 8 9 9
 6
87 86 86 86 85 86
 5
64 63 63 62 61
 3
76 9 12
 4
61 60 60 60
 7
23 37 39 8 72 31 85
 10
67 67 67 67 67 67 67 67 67 67
 4
92 18 29 93
 4
14 15 15 16
 10
79 84 22 38 23 22 33 42 13 96
 7
20 21 95 73 49 98 53
 10
28 61 23 73 61 33 45 55 18 43
 9
15 14 14 13 13 12 13 13 14
 5
46 46 47 46 45
 7
35 91 87 78 17 71 63
 3
69 26 73
 10
16 17 16 15 14 15 16 17 16 15
 9
95 7 97 61 90 7 30 65 39
 10
2 83 18 65 58 95 37 51 86 47
 6
59 59 60 60 59 58

YES YES NO NO NO NO NO NO NO YES YES NO NO YES YES YES NO YES YES YES YES NO YES NO YES NO YES NO NO NO YES YES NO NO YES NO NO YES
#include <bits/stdc++.h>
const double PI = 3.141592653589793238463;
using namespace std;
inline long long add(long long a, long long b) {
  a += b;
  if (a >= 1000000007) a -= 1000000007;
  return a;
}
inline long long sub(long long a, long long b) {
  a -= b;
  if (a < 0) a += 1000000007;
  return a;
}
inline long long mul(long long a, long long b) {
  return (long long)((long long)a * b % 1000000007);
}
long long fast_power(long long base, long long power) {
  long long result = 1;
  while (power > 0) {
    if (power % 2 == 1) {
      result = (result * base);
    }
    base = (base * base);
    power = power / 2;
  }
  return result;
}
long long min(long long a, long long b) { return a > b ? b : a; }
long long max(long long a, long long b) { return a > b ? a : b; }
void SieveOfEratosthenes(long long n, unordered_set<long long> &s) {
  bool prime[n + 1];
  memset(prime, true, sizeof(prime));
  for (long long p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (int i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
  for (long long p = 2; p <= n; p++)
    if (prime[p]) s.insert(p);
}
void dfs(long long s, vector<bool> &vis, vector<vector<long long>> &adlist) {
  if (vis[s]) return;
  vis[s] = true;
  for (auto x : adlist[s]) {
    if (vis[x] == false) {
      cout << s << " " << x << "\n";
    }
    dfs(x, vis, adlist);
  }
}
void bfs(long long x, vector<bool> &vis, vector<vector<long long>> &adlist) {
  queue<long long> q;
  vis[x] = true;
  q.push(x);
  while (!q.empty()) {
    long long s = q.front();
    q.pop();
    for (auto u : adlist[s]) {
      if (vis[u]) continue;
      vis[u] = true;
      q.push(u);
    }
  }
}
bool bpchk(vector<vector<long long>> &adj, vector<long long> &color) {
  color[1] = 1;
  queue<long long> q;
  q.push(1);
  while (!q.empty()) {
    long long u = q.front();
    q.pop();
    for (auto x : adj[u]) {
      if (color[x] == -1) {
        color[x] = color[u] ^ 1;
        q.push(x);
      }
    }
  }
  for (long long i = 1; i < adj.size(); i++) {
    for (auto x : adj[i]) {
      if (color[x] == color[i]) return false;
    }
  }
  return true;
}
bool cfun(pair<long long, long long> p1, pair<long long, long long> p2) {
  if (p1.second < p2.second) {
    return true;
  }
  return false;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  bool flag = true;
  for (long long i = 1; i < n; i++) {
    if (abs(a[i] - a[i - 1]) >= 2) {
      flag = false;
      break;
    }
  }
  if (flag == false) {
    cout << "NO"
         << "\n";
  } else {
    cout << "YES"
         << "\n";
  }
}
