#include <bits/stdc++.h>
using namespace std;
template <typename T>
void cins(vector<T>& arr) {
  for (T& e : arr) cin >> e;
}
int main(void) {
  int num;
  cin >> num;
  vector<int> arr(num);
  cins(arr);
  map<int, int> map;
  for (int i = 0; i < num; i++) map[arr[i]]++;
  bool ans = 0;
  if (map.size() != 3 || (num % 3)) {
    goto finish;
  } else {
    int sz = num / 3;
    vector<int> arr2;
    for (pair<int, int> elem : map) {
      arr2.push_back(elem.first);
      if (elem.second != sz) goto finish;
    }
    vector<int> idx = {0, 1, 2};
    int flag = 1;
    do {
      flag &= ((arr2[idx[0]] ^ arr2[idx[1]]) == arr2[idx[2]]);
    } while (next_permutation(idx.begin(), idx.end()));
    ans = flag;
  }
finish:
  cout << (ans ? "Yes" : "No") << endl;
  return 0;
}
