#include <bits/stdc++.h>
using namespace std;
template <typename T>
void read(T &x) {
  x = 0;
  char c;
  for (c = getchar(); !isdigit(c); c = getchar())
    ;
  for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
}
const int N = 3e5 + 50;
int n, a[N];
int main(int argc, char *argv[]) {
  bool suc = true;
  read(n);
  for (int i = 1; i <= (n); ++i) read(a[i]);
  suc &= n % 3 == 0;
  ;
  sort(a + 1, a + n + 1);
  int x = a[n / 3], y = a[n / 3 + 1], z = a[n / 3 * 2 + 1];
  suc &= a[1] == x && y == a[n / 3 * 2] && z == a[n] && x != y && y != z;
  ;
  if ((x ^ y) == z || (x ^ z) == y || (y ^ z) == x)
    ;
  else
    suc &= false;
  puts(suc ? "Yes" : "No");
  return 0;
}
