#include <bits/stdc++.h>
using namespace std;
inline void rd(int &x) {
  int k, m = 0;
  x = 0;
  for (;;) {
    k = getchar_unlocked();
    if (k == '-') {
      m = 1;
      break;
    }
    if ('0' <= k && k <= '9') {
      x = k - '0';
      break;
    }
  }
  for (;;) {
    k = getchar_unlocked();
    if (k < '0' || k > '9') {
      break;
    }
    x = x * 10 + k - '0';
  }
  if (m) {
    x = -x;
  }
}
inline void wt_L(char a) { putchar_unlocked(a); }
inline void wt_L(const char c[]) {
  int i = 0;
  for (i = 0; c[i] != '\0'; i++) {
    putchar_unlocked(c[i]);
  }
}
int N;
int A[100000];
int main() {
  rd(N);
  {
    int Lj4PdHRW;
    for (Lj4PdHRW = 0; Lj4PdHRW < N; Lj4PdHRW++) {
      rd(A[Lj4PdHRW]);
    }
  }
  sort(A, A + N);
  if (A[0] == A[N - 1]) {
    wt_L("Yes");
    wt_L('\n');
    return 0;
  }
  if (N % 3) {
    wt_L("No");
    wt_L('\n');
    return 0;
  }
  if (A[0] == A[N / 3 - 1] && A[N / 3] == A[2 * N / 3 - 1] &&
      A[2 * N / 3] == A[N - 1] && (A[0] ^ A[N / 3] ^ A[2 * N / 3]) == 0) {
    wt_L("Yes");
    wt_L('\n');
    return 0;
  }
  wt_L("No");
  wt_L('\n');
  return 0;
}
