#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<int, int> ma;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    ma[a]++;
  }
  if (ma.size() == 1)
    cout << "Yes" << endl;
  else if (n % 3 == 0) {
    vector<int> v;
    for (auto x : ma) {
      for (int i = n / 3; i <= x.second; i += n / 3) v.push_back(x.first);
    }
    cout << (v.size() == 3 && ((v[0] ^ v[1]) == v[2]) ? "Yes" : "No") << endl;
  } else
    cout << "No" << endl;
  return 0;
}
