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