#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
using namespace std;
const long long int MAX = -1000000000000000000;
const long long int MIN = 1000000000000000000;
const long long int inf = 1000000000;
const long long int KOK = 100000;
const long long int LOG = 30;
const long long int li = 500005;
const long long int mod = 1000000007;
long long int n, m, b[li], a[li], k, flag, t;
long long int cev;
string s;
vector<long long int> v;
int main(void) {
  scanf("%lld", &n);
  for (long long int i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
  }
  sort(a + 1, a + n + 1);
  reverse(a + 1, a + n + 1);
  long long int koy = n / 2 + 1;
  long long int eksi = 1;
  long long int arti = 1;
  b[koy] = a[n];
  long long int az = n - 1;
  if (n == 3) {
    if ((a[1] ^ a[3]) == a[2] && (a[1] ^ a[2]) == a[3] &&
        (a[2] ^ a[3]) == a[1]) {
      printf("Yes\n");
      return 0;
    }
  }
  while (koy - eksi >= 1 && koy + arti <= n) {
    if (koy + arti > n)
      b[1] = a[1];
    else {
      b[koy + arti] = a[az];
      az++;
      b[koy - eksi] = a[az];
      az++;
    }
    eksi++;
    arti++;
  }
  for (int i = 2; i < n; i++) {
    if ((b[i - 1] ^ b[i + 1]) != b[i]) {
      printf("No\n");
      return 0;
    }
  }
  if ((b[2] ^ b[n]) != b[1]) {
    printf("No\n");
    return 0;
  }
  if ((b[1] ^ b[n - 1]) != b[n]) {
    printf("No\n");
    return 0;
  }
  printf("Yes\n");
  return 0;
}
