#include <bits/stdc++.h>
using namespace std;
int main(void) {
  uint32_t N{};
  cin >> N;
  vector<uintmax_t> originalBits(N);
  map<uintmax_t, intmax_t> mapA{};
  for (size_t i = 0; i < originalBits.size(); ++i) {
    cin >> originalBits[i];
    if (mapA.find(originalBits[i]) == mapA.end()) {
      mapA[originalBits[i]] = 1;
    } else {
    }
  }
  vector<uintmax_t> usedBits(N);
  --mapA[originalBits[0]];
  usedBits[0] = originalBits[0];
  --mapA[originalBits[1]];
  usedBits[1] = originalBits[1];
  bool ans{true};
  for (size_t i = 2; i < originalBits.size(); ++i) {
    uintmax_t currentBit = usedBits[i - 2] ^ usedBits[i - 1];
    if (mapA.find(currentBit) == mapA.end() && mapA[currentBit] == 0) {
      ans = false;
      break;
    } else {
      --mapA[currentBit];
      usedBits[i] = currentBit;
    }
  }
  if (ans) {
    if (usedBits[0] == (usedBits[N - 2] ^ usedBits[N - 1]) &&
        usedBits[1] == (usedBits[N - 1] ^ usedBits[0])) {
      ans = true;
    } else {
      ans = false;
    }
  }
  string ans_txt = ans ? "Yes" : "No";
  cout << ans_txt << endl;
  return 0;
}
