#include <bits/stdc++.h>
using namespace std;
const int N = 8e4;
int cas, n;
long long A[N + 3];
map<long long, int> cnt;
bool Solve2() {
  int stk[5] = {}, nstk = 0;
  for (map<long long, int>::iterator it = cnt.begin(); it != cnt.end(); it++) {
    if (it->second != n / 3 * 2 && it->second != n / 3) return false;
    if (it->second == n / 3 * 2)
      stk[++nstk] = it->first, stk[++nstk] = it->first;
    else
      stk[++nstk] = it->first;
  }
  sort(stk + 1, stk + 4);
  do {
    if ((stk[3] ^ stk[1]) == stk[2] && (stk[1] ^ stk[2]) == stk[3] &&
        (stk[2] ^ stk[3]) == stk[1])
      return true;
  } while (next_permutation(stk + 1, stk + 4));
  return false;
}
bool Solve3() {
  int stk[5] = {}, nstk = 0;
  for (map<long long, int>::iterator it = cnt.begin(); it != cnt.end(); it++) {
    if (it->second != n / 3) return false;
    stk[++nstk] = it->first;
  }
  sort(stk + 1, stk + 4);
  do {
    if ((stk[3] ^ stk[1]) == stk[2] && (stk[1] ^ stk[2]) == stk[3] &&
        (stk[2] ^ stk[3]) == stk[1])
      return true;
  } while (next_permutation(stk + 1, stk + 4));
  return false;
}
int main() {
  cas = 1;
  while (cas--) {
    cnt.clear();
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
      scanf("%lld", &A[i]);
      cnt[A[i]]++;
    }
    if (cnt.size() > 3) {
      printf("No\n");
      continue;
    }
    switch (cnt.size()) {
      case 1:
        if (cnt.begin()->first == 0)
          printf("Yes\n");
        else
          printf("No\n");
        break;
      case 2:
        printf("%s\n", Solve2() ? "Yes" : "No");
        break;
      case 3:
        printf("%s\n", Solve3() ? "Yes" : "No");
        break;
    }
  }
  return 0;
}
