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