#include <bits/stdc++.h>
using namespace std;
const int N = 110;
int a[N], n;
int main() {
cin >> n;
for (int i = 0; i < n; i ++ ) cin >> a[i];
bool ok = true;
for (int i = 1; i < n; i ++ )
if (a[i] - a[i - 1] != 1) ok = false;
if (ok) puts("YES");
else puts("NO");
return 0;
}