#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
int main() {
  ll N;
  cin >> N;
  vector<ll> an(N);
  unordered_map<ll, ll> vnum;
  for (auto&& a : an) {
    cin >> a;
    ++vnum[a];
  }
  bool ret = false;
  if (vnum.size() == 1 && vnum.begin()->first == 0) {
    ret = true;
  }
  if (N % 3 == 0 && vnum.size() == 2 && vnum.count(0) == N / 3) {
    ret = true;
  }
  if (N % 3 == 0 && vnum.size() == 3) {
    ll x = 0;
    bool ret3 = true;
    for (auto& d : vnum) {
      x ^= d.first;
      if (d.second != N / 3) {
        ret3 = false;
      }
    }
    if (x != 0) ret3 = false;
    ret |= ret3;
  }
  cout << (ret ? "Yes" : "No") << endl;
  return 0;
}
