#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll n;
  cin >> n;
  ll keta[40];
  fill(keta, keta + 40, 0);
  for (int i = 0; i < n; i++) {
    ll temp;
    cin >> temp;
    for (int j = 0; j < 40; j++) {
      keta[j] += (temp >> j & 1);
    }
  }
  for (int i = 0; i < 40; i++) {
    if (keta[i] == 0 || keta[i] == n || (n - keta[i]) * 2 == keta[i]) {
      continue;
    }
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
}
