#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
vector<int> a;
multiset<int> p;
vector<pair<int, int> > sol;
int main() {
  ios_base::sync_with_stdio(false);
  int N;
  cin >> N;
  for (int i = 0; i < N; i++) {
    int o;
    cin >> o;
    a.push_back(o);
    p.insert(o);
  }
  int primo = -1;
  int prec;
  for (int i = 1; i < N; i++) {
    int g = a[i] ^ a[0];
    if (p.find(g) != p.end()) {
      sol.push_back({a[i], g});
      sol.push_back({g, a[i]});
    }
  }
  for (int i = 0; i < sol.size(); i++) {
    p.clear();
    for (int i = 0; i < N; i++) p.insert(a[i]);
    int primo = sol[i].first;
    int prec = sol[i].second;
    p.erase(p.find(primo));
    p.erase(p.find(prec));
    for (int i = 1; i < N - 1; i++) {
      int g = a[i] ^ prec;
      if (p.find(g) != p.end()) {
        prec = g;
        p.erase(p.find(g));
      } else {
        break;
      }
    }
    if (a[N - 1] ^ prec == primo) {
      cout << "Yes";
      return 0;
    }
  }
  cout << "No";
  return 0;
}
