#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);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (n); ++i) {
    cin >> a[i];
    mep[a[i]]++;
  }
  vector<int> res;
  res.reserve(n);
  int ind = rnd() % n;
  res.push_back(a[ind]);
  mep[a[ind]]--;
  for (int i = 0; i < (n); ++i) {
    if (mep[a[i]] == 0) {
      continue;
    }
    res.push_back(a[i]);
    mep[a[i]]--;
    while (true) {
      int sz = ((int)res.size());
      int el = res[sz - 1] ^ res[sz - 2];
      if (mep[el] > 0) {
        res.push_back(el);
        mep[el]--;
      } else {
        break;
      }
    }
    if (((int)res.size()) == n) {
      if (res[n - 1] == (res[0] ^ res[n - 2])) {
        cout << "YES\n";
        return 0;
      }
    }
    while (((int)res.size()) > 1) {
      mep[res.back()]++;
      res.pop_back();
    }
  }
  cout << "NO\n";
  return 0;
}
