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