#include <bits/stdc++.h>
using namespace std;
using ll = long long;
vector<string> bit;
string toBin(ll n) {
  if (n == 1)
    return "1";
  else if (n == 0)
    return "0";
  return toBin(n / 2) + to_string(n % 2);
}
int main() {
  ll n;
  cin >> n;
  vector<ll> a(n);
  vector<ll> count(17, 0);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort((a).begin(), (a).end());
  bool done[n];
  for (int i = 0; i < n; i++) done[i] = false;
  ll start = a[n - 1];
  done[n - 1] = true;
  vector<ll> vec(3, -1);
  vec[1] = a[n - 1];
  for (int i = n - 2; i >= 0; i--) {
    vec[2] = a[i];
    ll xr = (vec[1] ^ vec[2]);
    done[i] = true;
    ll res = lower_bound((a).begin(), (a).end(), xr) - a.begin();
    while (done[res] && a[res] == xr) {
      res++;
    }
    if (a[res] != xr) continue;
    vec[0] = a[res];
    done[res] = true;
    for (int j = 0; j < n - 1; j++) {
      if (a[j]) continue;
      ll x = (vec[vec.size() - 1] ^ a[j]);
      ll pos = lower_bound((a).begin(), (a).end(), x) - a.begin();
      while (done[pos] && a[pos] == x) {
        pos++;
      }
      if (a[pos] != xr) break;
      vec.push_back(a[pos]);
    }
    if (vec.size() == n) {
      if ((vec[0] ^ vec[vec.size() - 2]) == vec[vec.size() - 1]) {
        cout << "Yes";
        return 0;
      }
    }
  }
  cout << "No";
  return 0;
}
