#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  long long tmp;
  cin >> N;
  bool judge = false;
  vector<long long> v;
  for (long long i = 0; i < N; ++i) {
    cin >> tmp;
    v.push_back(tmp);
  }
  std::sort(v.begin(), v.end());
  if (v[0] == v[N - 1]) {
    judge = true;
  }
  if (N % 3 == 0) {
    tmp = v[0] ^ v[N / 3];
    tmp ^= v[2 * N / 3];
    if (v[0] == v[N / 3 - 1] && v[N / 3] == v[2 * N / 3 - 1] &&
        v[2 * N / 3] == v[N - 1] && tmp == 0) {
      judge = true;
    }
  }
  if (judge) {
    cout << "Yes"
         << "\n";
  } else {
    cout << "No"
         << "\n";
  }
  return 0;
}
