#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
bool ok = true;
int prev;
for(int i = 0; i < n; i++)
{
int a;
cin >> a;
ok &= !(i && a - prev < 2);
prev = a;
}
cout << (ok ? "YES\n" : "NO\n");
return 0;
}