#include <bits/stdc++.h>
using namespace std;
template <typename T>
void read(T &x) {
  x = 0;
  char ch = getchar();
  long long f = 1;
  while (!isdigit(ch)) {
    if (ch == '-') f *= -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - 48;
    ch = getchar();
  }
  x *= f;
}
int n, a[100010], v[10] = {-1, -1, -1};
map<int, int> Mp;
int main() {
  read(n);
  for (int i = 0; i < n; i++) {
    read(a[i]);
    Mp[a[i]] += 1;
    for (int j = 0; j < 3; j++) {
      if (v[j] == -1) {
        v[j] = a[i];
        break;
      }
    }
  }
  for (int i = 0; i < 3; i++) {
    if (Mp[v[i]] != n / 3) {
      cout << "No" << endl;
      return 0;
    }
  }
  if ((v[0] ^ v[1]) != v[2]) {
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
  return 0;
}
