#include <bits/stdc++.h>
using namespace std;
using int64 = long long;
int main() {
  int n;
  cin >> n;
  unordered_multiset<int> a;
  int tmp;
  for (int(i) = 0; (i) < (n); ++(i)) {
    cin >> tmp;
    a.insert(tmp);
  }
  int a0 = *(a.begin());
  auto a1_it = a.begin();
  ++a1_it;
  for (; a1_it != a.end(); ++a1_it) {
    int cand = a0 ^ (*a1_it);
    auto a2_range = a.equal_range(cand);
    if (a2_range.first != a.end()) {
      auto a2_it = a2_range.first;
      for (; a2_it != a2_range.second; ++a2_it) {
        if (a2_it != a.begin() && a2_it != a1_it) {
          break;
        }
      }
      if (a2_it != a2_range.second) {
        break;
      }
    }
  }
  if (a1_it == a.end()) {
    cout << "No" << endl;
    return 0;
  }
  int a1 = *(a1_it);
  int an = a0;
  int an1 = *a1_it;
  a.erase(a.find(an));
  a.erase(a.find(an1));
  while (a.size()) {
    int an2 = an ^ an1;
    auto an2_it = a.find(an2);
    if (an2_it == a.end()) {
      cout << "No" << endl;
      return 0;
    }
    a.erase(a.find(an2));
    an = an1;
    an1 = an2;
  }
  if ((an ^ an1) != a0) {
    cout << "No" << endl;
    return 0;
  }
  if ((an1 ^ a0) != a1) {
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
  return 0;
}
