#include <cstdio>
using namespace std;
int N, H0, H1;
int main() {
  scanf("%d", &N);
  for(int i = 0; i < N; i++) {
    scanf("%d", &H1);
    if(i == 0) H0 = H1;
    if(H0 > H1) {printf("No"); return 0;}
    if(H0 < H1) H1--;
    H0 = H1;
  }
  printf("Yes");
}