#include <bits/stdc++.h>
using namespace std;
const long long inf = 2000000000000000000LL;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t, n, m, i, j, k, temp, flag, ans;
  cin >> n;
  map<long long, long long> mp;
  long long a[n];
  for (i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  for (i = 0; i < n; i++) {
    if (a[i] != i + 1) {
      cout << "NO";
      return 0;
    }
  }
  cout << "Yes";
  return 0;
}
