#include <bits/stdc++.h>
using namespace std;
const int INF = 1000 * 1000 * 1000 + 7;
const long long LINF = 1LL * INF * INF;
const int MAX = 1e6 + 7;
const double PI = acos(-1.);
const double EPS = 1e-7;
const int MAXN = 100005;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
unordered_map<int, int> mep(200007);
int main() {
  ios_base::sync_with_stdio(0);
  freopen("input.txt", "r", stdin);
  time_t st = clock();
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (n); ++i) {
    cin >> a[i];
    mep[a[i]]++;
  }
  deque<int> res;
  int ind = rnd() % n;
  res.push_back(a[ind]);
  mep[a[ind]]--;
  for (int i = 0; i < (n); ++i) {
    if (mep[a[i]] == 0 || !mep.count(a[i] ^ a[ind]) ||
        mep[a[i] ^ a[ind]] == 0) {
      continue;
    }
    res.push_back(a[i]);
    mep[a[i]]--;
    int it = 0;
    while (true) {
      if (((double)clock() - st) / CLOCKS_PER_SEC >= 1.9) {
        cout << "No\n";
        return 0;
      }
      ++it;
      if (it % 2 == 0) {
        int sz = ((int)res.size());
        int el = res[sz - 1] ^ res[sz - 2];
        if (mep.count(el) && mep[el] > 0) {
          res.push_back(el);
          mep[el]--;
        } else {
          break;
        }
      } else {
        int el = res[0] ^ res[1];
        if (mep.count(el) && mep[el] > 0) {
          res.push_front(el);
          mep[el]--;
        } else {
          break;
        }
      }
    }
    if (((int)res.size()) == n) {
      cout << "Yes\n";
      return 0;
    }
    while (((int)res.size()) > 1) {
      mep[res.back()]++;
      res.pop_back();
    }
  }
  cout << "No\n";
  return 0;
}
