#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
const vector<ll> dx = {0, 1, 0, -1}, dy = {1, 0, -1, 0};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll N;
  cin >> N;
  vector<ll> a(N);
  for (ll i = 0; i < N; ++i) {
    cin >> a[i];
  }
  for (ll i = 2;; ++i) {
    ll hoge = 1 << i;
    if (hoge < N + 1) {
      continue;
    }
    if (hoge != N + 1) {
      cout << "No" << endl;
      return 0;
    }
    break;
  }
  sort(a.begin(), a.end());
  for (ll i = 1; i <= N; ++i) {
    if (i != a[i - 1]) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}
