#include <bits/stdc++.h>
using namespace std;
long long int n, m, a, b, c, x, y, z, aa[200010], ab[200010], ac[1010];
bool r, ra, rb, rc[200010];
string s, sa, sb, sc;
char ca, cb, cc, cd[1010][1010];
vector<long long int> va, vb, vc, vd, ve;
set<int> st;
template <typename MAIN>
ostream& operator<<(ostream& osys, const vector<MAIN> target) {
  for (MAIN it : target) osys << it << " ";
  return osys;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> aa[i];
    va.push_back(aa[i]);
  }
  va.push_back(aa[0]);
  m = va[0];
  a = va[1];
  for (int i = 1; i < n; i++) {
    a = va[i];
    if ((m xor a) != m and (m xor a) != a) {
      swap(va[1], va[i]);
      break;
    }
  }
  vb = {va[0], va[1]};
  for (int i = 1; i < n; i++) {
    m = vb[i - 1] xor vb[i];
    vb.push_back(m);
  }
  sort(va.begin(), va.end());
  sort(vb.begin(), vb.end());
  cout << (va == vb ? "Yes" : "No") << endl;
}
