#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  int cnt0 = 0;
  set<int> st;
  for (int i = 0; i < N; ++i) {
    cin >> a[i];
    if (a[i] == 0) {
      ++cnt0;
    } else {
      st.insert(a[i]);
    }
  }
  bool ok = false;
  if (cnt0 == N) {
    ok = true;
  }
  if (N % 3 == 0 && st.size() == 3) {
    vector<int> v;
    for (auto it = st.begin(); it != st.end(); ++it) {
      v.push_back(*it);
    }
    if ((v[0] == (v[1] ^ v[2])) && (v[1] == (v[0] ^ v[2])) &&
        (v[2] == (v[1] ^ v[0]))) {
      ok = true;
    }
  }
  cout << (ok ? "Yes" : "No") << endl;
  return 0;
}
