#include <bits/stdc++.h>
using namespace std;
using ll = long long;
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]]++;
  }
  if (cnt[0] == N) {
    cout << "Yes";
    return 0;
  }
  if (N % 3 != 0) {
    cout << "No";
    return 0;
  }
  vector<int> all;
  for (auto& e : cnt) {
    for (int(i) = 0; (i) < (e.second / (N / 3)); (i)++)
      all.emplace_back(e.first);
  }
  if (all.size() == 3 && (all[0] ^ all[1] ^ all[2] == 0)) {
    cout << "Yes";
  } else {
    cout << "No";
  }
  return 0;
}
