#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> a(N), x(N);
  stack<bitset<100001>> rs;
  stack<int> ks, is;
  bitset<100001> r;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    r[i] = 0;
  }
  x[0] = a[0];
  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();
        rs.pop();
        ks.pop();
        is.pop();
        k++;
        continue;
      } else {
        cout << "No" << endl;
        return 0;
      }
    }
    if (r[k] == 1) {
      k++;
      continue;
    }
    if (i == 1 || (x[i - 2] ^ a[k]) == x[i - 1]) {
      if (i > 1) {
      }
      x[i] = a[k];
      rs.push(r);
      r.set(k);
      ks.push(k);
      is.push(i);
      k = 0;
      i++;
      continue;
    } else {
      k++;
      continue;
    }
  }
  int k;
  for (k = 0; k < N; k++) {
    if (r[k] == 0) break;
  }
  cerr << "e: " << x[N - 3] << " " << x[N - 2] << " " << a[k] << " " << x[0];
  if ((a[k] ^ x[N - 3]) == x[N - 2] && (x[0] ^ x[N - 2]) == a[k]) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
