#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1000000007;
const long long int INF = (long long int)1e15;
long long int N;
long long int A[100005];
bool U[100005];
string solve() {
  sort(A, A + N);
  long long int s = -1;
  long long int t = -1;
  for (long long int(i) = (1); (i) < (N); ++(i)) {
    long long int x = A[0] ^ A[i];
    auto it = lower_bound(A + i + 1, A + N, x);
    if (it == A + N || *it != x) continue;
    s = i;
    t = it - (A);
  }
  if (s < 0 || t < 0) return "No";
  U[0] = U[s] = U[t] = true;
  vector<long long int> v;
  v.push_back(A[0]);
  v.push_back(A[s]);
  v.push_back(A[t]);
  while (v.size() < N) {
    long long int num = v.size();
    auto it = lower_bound(A, A + N, v[num - 1] ^ v[num - 2]);
    if (it == A + N) return "No";
    int index = it - A;
    while (!U[index]) index++;
    if (v[num - 1] ^ v[num - 2] != A[index]) return "No";
    v.push_back(A[index]);
    U[index] = true;
  }
  if (v[0] ^ v[1] != v[N - 1]) return "No";
  return "Yes";
}
int main() {
  cin >> N;
  for (long long int(i) = (0); (i) < (N); ++(i)) {
    cin >> A[i];
  }
  cout << solve() << endl;
  return 0;
}
