#include <bits/stdc++.h>
int main() {
  unsigned long long a, i, b[200000], f = 1;
  scanf("%ld", &a);
  for (i = 1; i <= a; i++) {
    scanf("%ld", &b[i]);
    if (b[i] != i) f = 0;
  }
  if (f == 1)
    printf("Yes");
  else
    printf("No");
}
