#include <bits/stdc++.h>
using namespace std;
using p = pair<long long, long long>;
long long dx[4] = {-1, 0, 1, 0};
long long dy[4] = {0, 1, 0, -1};
int main(void) {
  long long n;
  cin >> n;
  long long a[n];
  bool ok = true;
  long long MAX = 0;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    MAX = max(MAX, a[i]);
  }
  for (long long d = 0; d < 30; d++) {
    long long n1 = 0, n0 = 0;
    if (MAX < (long long)1 << d) break;
    for (long long i = 0; i < n; i++) {
      if ((a[i]) & (1 << d))
        n1++;
      else
        n0++;
    }
    if (n1 != n0 + 1) {
      ok = false;
      break;
    }
  }
  if (ok == true)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
