#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
struct Edge {
  int to;
  int weight;
  Edge(int t, int w) : to(t), weight(w) {}
};
int main() {
  int N;
  cin >> N;
  map<int, int> mp;
  for (int i = 0; i < N; ++i) {
    int a;
    cin >> a;
    mp[a]++;
  }
  if (mp[0] == N) {
    cout << "Yes" << endl;
    return 0;
  }
  if (N % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  vector<int> all;
  for (auto& p : mp) {
    for (int i = 0; i < p.second / (N / 3); ++i) {
      all.emplace_back(p.first);
    }
  }
  if (all.size() == 3 && (all[0] ^ all[1] ^ all[2] == 0)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
