#include <bits/stdc++.h>
using namespace std;
int N;
vector<int> a;
vector<int> r;
int ag(int idx) { return a[idx % N]; }
int as(int idx, int value) { a[idx % N] = value; }
int rg(int idx) { return r[idx % N]; }
void rs(int idx, int value) { r[idx % N] = value; }
int main() {
  cin >> N;
  a = vector<int>(N);
  r = vector<int>(N, -1);
  for (int i = 0; i < N; ++i) {
    int in;
    cin >> in;
    a[i] = in;
  }
  sort(a.begin(), a.end());
  rs(0, a[0]);
  rs(1, a[1]);
  as(0, -1);
  as(0, -1);
  bool yes = true;
  for (int i = 0; i < N; ++i) {
    int rk = rg(i);
    int rk1 = rg(i + 1);
    int rk2 = ag(i + 2);
    if ((rk ^ rk1) != rk2) {
      yes = false;
      break;
    } else {
      rs(i + 2, rk2);
      as(i + 2, -1);
    }
  }
end:;
  if (yes) {
    cout << "Yes" << endl;
  } else {
    sort(a.begin(), a.end());
    if ((r[N - 1] ^ a[N - 1]) == r[0]) {
      cout << "Yes" << endl;
    } else
      cout << "No" << endl;
  }
  return 0;
}
