#include <bits/stdc++.h>
using namespace std;
const long long INF = 100100100100100100;
const int MOD = 1000000007;
const int inf = 1001001001;
long long mod_pow(long long N, long long M) {
  if (M == 0) return 1;
  long long res = mod_pow((N * N) % MOD, M / 2);
  if (M & 1) res = (res * N) % MOD;
  return res %= MOD;
}
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
int main() {
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
  int N;
  cin >> N;
  vector<long long> retu(N);
  for (int i = 0; i < N; i++) cin >> retu.at(i);
  vector<int> bitCount(32);
  for (int i = 0; i < N; i++) {
    bitset<32> BIT(retu.at(i));
    for (int j = 0; j < 32; j++) {
      if (BIT.test(j)) bitCount.at(j)++;
    }
  }
  bool ok = true;
  for (int i = 0; i < 32; i++) {
    int need = N / 2;
    if (bitCount.at(i) >= need && (N - bitCount.at(i)) >= need ||
        bitCount.at(i) == 0) {
    } else {
      ok = false;
    }
  }
  if (ok) {
    cout << "Yes"
         << "\n";
    ;
  } else {
    cout << "No"
         << "\n";
    ;
  }
}
