#include <bits/stdc++.h>
using namespace std;
bool func1(const vector<int>& ar) {
  unordered_map<int, int> map;
  for (auto a : ar) {
    if (map.count(a) > 0) {
      map[a] = 1;
    } else {
      map[a]++;
    }
  }
  if (map.size() != 3) {
    return false;
  }
  for (auto ite : map) {
    if (ite.second != ar.size() / 3) {
      return false;
    }
  }
  int r = 0;
  for (auto ite : map) {
    r = r ^ ite.first;
  }
  if (r == 0) {
    return true;
  } else {
    return false;
  }
}
int main(int argc, char* argv[]) {
  int n;
  cin >> n;
  vector<int> ar;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    ar.push_back(a);
  }
  bool ok = all_of(ar.begin(), ar.end(), [](int x) { return x == 0; });
  if (ok) {
    cout << "Yes" << endl;
    return 0;
  }
  ok = func1(ar);
  if (ok) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
