#include <bits/stdc++.h>
using namespace std;
void ga(int N, int *A) {
  for (int i(0); i < N; i++) scanf("%d", A + i);
}
map<int, int> T;
int L, N, a, A[1 << 17], B[666];
int main(void) {
  scanf("%d", &N);
  for (int i(0); i < N; i++) scanf("%d", &a), ++T[a];
  if (T.size() > 3u) return puts("No"), 0;
  if (T.size() == 1u && T[0] == N) return puts("Yes"), 0;
  if (T.size() == 2u) return puts("No"), 0;
  for (auto &h : T) A[L] = h.first, B[L++] = h.second;
  for (int i(0); i < 3; i++)
    for (int j(0); j < 3; j++)
      for (int k(0); k < 3; k++)
        if (i != k && i != j && j != k && (A[i] ^ A[j]) != A[k])
          return puts("No"), 0;
  if (*B != B[1] && B[2] != *B) return puts("No"), 0;
  puts("Yes");
  return 0;
}
