#include <bits/stdc++.h>
int main() {
  int n, p;
  scanf("%d", &n);
  int a[n];
  for (int i = 0; i <= n - 1; i++) {
    scanf("%d", &a[i]);
  }
  p = 0;
  for (int i = 0; i < n - 1; i++) {
    if (a[i] == a[i + 1] - 1) {
      p++;
    } else {
      puts("no");
      break;
    }
    if (p == n - 1) {
      puts("yes");
    }
  }
  return 0;
}
