#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) = (0); (i) < (N - 1); ++(i)) {
    long long int x = A[N - 1] ^ A[i];
    long long int ok = i, ng = N - 1;
    while (abs(ok - ng) > 1) {
      long long int mid = (ok + ng) / 2;
      if (A[mid] <= x)
        ok = mid;
      else
        ng = mid;
    }
    if (ok == i || A[ok] != x) continue;
    s = i;
    t = ok;
  }
  if (s < 0 || t < 0) return "No";
  U[N - 1] = U[s] = U[t] = true;
  vector<long long int> v;
  v.push_back(A[N - 1]);
  v.push_back(A[s]);
  v.push_back(A[t]);
  while (v.size() < N) {
    long long int num = v.size();
    long long int x = v[num - 1] ^ v[num - 2];
    long long int ok = -1, ng = N;
    while (abs(ok - ng) > 1) {
      long long int mid = (ok + ng) / 2;
      if (A[mid] <= x)
        ok = mid;
      else
        ng = mid;
    }
    int index = ok;
    while (!U[index] && index >= 0) index--;
    if (index < 0 || x != 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;
}
