#include <bits/stdc++.h>
using namespace std;
int n, m, i, j;
map<int, int> mp;
vector<int> seq;
int main() {
  scanf("%d", &n);
  if (n % 3 != 0) {
    puts("No");
    return 0;
  }
  for ((i) = 1; (i) <= (n); (i)++) {
    int x;
    scanf("%d", &x);
    mp[x]++;
  }
  for (__typeof((mp).begin()) it = (mp).begin(); it != (mp).end(); it++) {
    int t = it->second;
    while (t) {
      if (t < 0) {
        puts("No");
        return 0;
      }
      seq.push_back(it->first);
      t -= n / 3;
    }
  }
  if ((seq[0] ^ seq[1]) != seq[2]) {
    puts("No");
    return 0;
  }
  puts("Yes");
  return 0;
}
