#include <bits/stdc++.h>
using namespace std;
long long n;
long long a[100001];
vector<long long> vs;
map<long long, long long> tot;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n;
  for (long long i = (long long)(0); i < (long long)(n); i++) {
    cin >> a[i];
    vs.push_back(a[i]);
    tot[a[i]]++;
  }
  sort((vs).begin(), (vs).end());
  vs.erase(unique((vs).begin(), (vs).end()), vs.end());
  for (long long i = (long long)(0); i < (long long)(vs.size()); i++)
    for (long long j = (long long)(0); j < (long long)(vs.size()); j++) {
      bool ok = true;
      map<long long, long long> cnt = tot;
      long long b[3];
      b[0] = vs[i];
      b[1] = vs[j];
      b[2] = vs[i] ^ vs[j];
      for (long long k = (long long)(0); k < (long long)(n); k++) {
        if (cnt[b[k % 3]] == 0) ok = false;
        cnt[b[k % 3]]--;
      }
      if (ok) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  cout << "No" << endl;
  return 0;
}
