#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  cin >> N;
  vector<vector<long long> > vv;
  bool flg;
  long long count = 0;
  for (int i = 0; i < N; i++) {
    long long a;
    cin >> a;
    if (a == 0) {
      count++;
    }
    flg = true;
    for (int j = 0; j < vv.size(); j++) {
      if (vv[j][0] == a) {
        flg = false;
        vv[j][1]++;
        break;
      }
    }
    if (flg) {
      vector<long long> v(2);
      v[0] = a;
      v[1] = 1;
      vv.push_back(v);
    }
    if (i > N / 2 && count < N / 4) {
      break;
    }
  }
  bool ok = false;
  if (vv.size() == 1) {
    if (vv[0][0] == 0) {
      cout << "Yes" << endl;
      return 0;
    }
  } else if (vv.size() == 2) {
    if (vv[1][0] == 0) {
      if (vv[0][1] == 2 * vv[1][1]) {
        ok = true;
      }
    } else if (vv[0][0] == 0) {
      if (2 * vv[0][1] == vv[1][1]) {
        ok = true;
      }
    }
  } else if (vv.size() == 3) {
    if (N % 3 != 0) {
      cout << "No" << endl;
      return 0;
    }
    if (vv[0][1] != vv[1][1] || vv[1][1] != vv[2][1] || vv[0][1] != vv[2][1]) {
      cout << "No" << endl;
      return 0;
    }
    if (vv[0][0] != (long long)(vv[1][0] ^ vv[2][0])) {
      cout << "No" << endl;
      return 0;
    }
    ok = true;
  } else {
    if (count == N / 3) {
      ok = true;
    }
  }
  if (!ok) {
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
  return 0;
}
