#include <bits/stdc++.h>

using namespace std;

int main(int argc, const char *argv[]) {
  int n;
  cin >> n;

  vector<int> va(n);
  map<int, int> cnts;
  for (int i = 0; i < n; i++) {
    cin >> va[i];
    cnts[va[i]]++;
  }

  if (cnts[0] == n) {
    cout << "Yes\n";
    return 0;
  }

  if (n % 3 != 0 || (cnts.size() != 2 && cnts.size() != 3)) {
    cout << "No\n";
    return 0;
  }

  bool ans;
  if (cnts.size() == 2) {
    auto p = *cnts.begin();
    ans = p.first == 0 && p.second == n / 3;
  } else {
    int xor_all = accumulate(cnts.begin(), cnts.end(), 0,
                             [&](auto a, auto b) { return a.first ^ b.first; });
    ans = xor_all == 0 && all_of(cnts.begin(), cnts.end(),
                                 [&](auto p) { return p.second == n / 3; });
  }

  cout << (ans ? "Yes" : "No") << '\n';
  return 0;
}
