#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  cin.tie(0)->sync_with_stdio(false);
  ll n;
  cin >> n;
  vector<ll> a(n);
  for (long long i = 0; i < (n); i++) cin >> a[i];
  set<ll> hat;
  for (long long i = 0; i < (n); i++) hat.insert(a[i]);
  ll cnt0 = 0;
  for (long long i = 0; i < (n); i++)
    if (a[i] == 0) cnt0++;
  map<ll, ll> hatM;
  for (long long i = 0; i < (n); i++) hatM[a[i]]++;
  bool ok = false;
  if (cnt0 == n)
    ok = true;
  else if (hatM.size() == 2) {
    if (hatM.count(0)) {
      ll cnt = 0;
      for (auto i : hatM)
        if (i.first != 0) cnt = i.second;
      if (hatM[0] * 2 == cnt) ok = true;
    }
  } else if (!(n % 3)) {
    ll tmp[3];
    ll i = 0;
    for (auto itr : hat) {
      tmp[i] = itr;
      i++;
    }
    bitset<32> bs(tmp[0] ^ tmp[1] ^ tmp[2]);
    if (bs == 0) ok = true;
  }
  if (ok)
    cout << "Yes" << '\n';
  else
    cout << "No" << '\n';
  return 0;
}
