#include <bits/stdc++.h>
using namespace std;
bool solve() {
  int n;
  scanf("%d", &n);
  vector<long long int> ds(n);
  for (int i = 0; i < ((int)(n)); i++) scanf("%lld", &ds[i]);
  bool allz = true;
  for (int i = 0; i < ((int)(n)); i++) allz &= (ds[i] == 0);
  if (allz) return true;
  if (n % 3 != 0) return false;
  map<long long int, int> ma;
  for (int i = 0; i < ((int)(n)); i++) ma[ds[i]]++;
  if (ma.size() == 3) {
    vector<long long int> ks;
    for (auto p : ma) {
      long long int k;
      int v;
      tie(k, v) = p;
      if (v * 3 != n) return false;
      ks.push_back(k);
    }
    return ks[0] ^ ks[1] == ks[2];
  } else if (ma.size() == 2) {
    return ma[0] * 3 == n;
  } else
    return false;
}
int main(void) {
  if (solve())
    puts("Yes");
  else
    puts("No");
  return 0;
}
