#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, p, pp, f;
  cin >> N;
  vector<int> a(N);
  stack<bitset<100001>> rs;
  stack<int> ks, is, ps, pps;
  bitset<100001> r;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    r[i] = 0;
  }
  f = a[0];
  p = a[0];
  pp = -1;
  r[0] = 1;
  for (int i = 1, k = 0; i < N - 1;) {
    if (k >= N) {
      if (!rs.empty()) {
        r = rs.top();
        k = ks.top();
        i = is.top();
        p = ps.top();
        pp = pps.top();
        rs.pop();
        ks.pop();
        is.pop();
        ps.pop();
        pps.pop();
        k++;
        continue;
      } else {
        cout << "No" << endl;
        return 0;
      }
    }
    if (r[k] == 1) {
      k++;
      continue;
    }
    if (i == 1 || (pp ^ a[k]) == p) {
      if (i > 1) {
      }
      rs.push(r);
      r.set(k);
      ks.push(k);
      is.push(i);
      ps.push(p);
      pps.push(pp);
      pp = p;
      p = a[k];
      k = 0;
      i++;
      continue;
    } else {
      k++;
      continue;
    }
  }
  int k;
  for (k = 0; k < N; k++) {
    if (r[k] == 0) break;
  }
  if ((a[k] ^ pp) == p && (f ^ p) == a[k]) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
