#include <bits/stdc++.h>
using namespace std;
long long a, b;
int main() {
  cin >> a;
  for (long long i = 1; i <= a; i++) {
    cin >> b;
    if (b != i) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
  return 0;
}
