#include <bits/stdc++.h>
using namespace std;
int N;
vector<long long> a;
int main() {
  cin >> N;
  a.resize(N);
  for (int i = 0; i < (N); i++) cin >> a[i];
  for (int i = 0; i < (30); i++) {
    int count1 = 0;
    for (auto e : a) {
      if (e & (1 << i)) count1 += 1;
    }
    if (count1 == 0 || count1 == ((N + 1) / 2)) {
      continue;
    } else {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}
