#include <bits/stdc++.h>
using namespace std;
int main(void) {
  uint32_t N{};
  cin >> N;
  vector<uintmax_t> originalBits(N);
  map<uintmax_t, uint64_t> mapA{};
  for (size_t i = 0; i < N; ++i) {
    cin >> originalBits[i];
    if (mapA.find(originalBits[i]) == mapA.end()) {
      mapA[originalBits[i]] = 0;
    }
    ++mapA[originalBits[i]];
  }
  bool ans{true};
  if (mapA.size() == 1) {
    if (mapA.find(0) != mapA.end() && mapA[0] == N) {
      ans = true;
    } else {
      ans = false;
    }
  } else if (mapA.size() == 2) {
    for (auto p : mapA) {
      if (p.first == 0) {
        ans &= (p.second == N / 3);
      } else {
        ans &= (p.second == (N * 2) / 3);
      }
    }
  } else if (mapA.size() == 3) {
    uintmax_t res = accumulate(mapA.begin(), mapA.end(), 0,
                               [](uintmax_t res, pair<uintmax_t, uint64_t> p) {
                                 return (res ^ p.first);
                               });
    ans = res && accumulate(mapA.begin(), mapA.end(), true,
                            [&N](bool res, pair<uintmax_t, uint64_t> p) {
                              return (res & (p.second == N / 3));
                            });
  } else {
    ans = false;
  }
  string ans_txt = ans ? "Yes" : "No";
  cout << ans_txt << endl;
  return 0;
}
