#include <bits/stdc++.h>
constexpr int dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
constexpr int dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
using namespace std;
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  map<int, int> mp;
  vector<int> v(n);
  for (ll i = 0; i < ll(n); ++i) {
    cin >> v[i];
    mp[v[i]]++;
  }
  int a = v[0], b = -1;
  if (--mp[v[0]] == 0) mp.erase(v[0]);
  for (ll i = 1; i < ll(n); ++i) {
    if (mp.count(v[0] ^ v[i])) {
      b = v[i];
      if (--mp[v[i]] == 0) mp.erase(v[i]);
      break;
    }
  }
  if (b == -1) {
    cout << "No" << endl;
    return 0;
  }
  for (ll i = 0; i < ll(n - 2); ++i) {
    if (mp.count(a ^ b)) {
      if (--mp[a ^ b] == 0) mp.erase(a ^ b);
      int c = a ^ b;
      a = b;
      b = c;
    } else {
      cout << "No" << endl;
    }
  }
  if (a ^ b == v[0]) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
