#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  map<int, int> cnt;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    cnt[a[i]]++;
  }
  if (cnt.size() > 3) {
    cout << "No" << endl;
    return 0;
  }
  vector<pair<int, int> > cnd;
  for (auto &x : cnt) {
    cnd.push_back(make_pair(x.first, x.second));
  }
  if (cnd.size() == 2) {
    if (cnd[0].second * 2 == cnd[1].second) {
      if ((cnd[1].first ^ cnd[1].first) != cnd[0].first) {
        cout << "No" << endl;
        return 0;
      }
      if ((cnd[1].first ^ cnd[0].first) != cnd[1].first) {
        cout << "No" << endl;
        return 0;
      }
    } else if (cnd[0].second == cnd[1].second * 2) {
      if ((cnd[0].first ^ cnd[0].first) != cnd[1].first) {
        cout << "No" << endl;
        return 0;
      }
      if ((cnd[1].first ^ cnd[0].first) != cnd[0].first) {
        cout << "No" << endl;
        return 0;
      }
    } else {
      cout << "No" << endl;
      return 0;
    }
  } else {
    if (!(cnd[0].second == cnd[1].second && cnd[1].second == cnd[2].second)) {
      cout << "No" << endl;
      return 0;
    }
    vector<int> ord = {cnd[0].first, cnd[1].first, cnd[2].first};
    sort(ord.begin(), ord.end());
    bool flag = false;
    do {
      if ((ord[0] ^ ord[2]) == ord[1] && (ord[1] ^ ord[0]) == ord[2]) {
        flag = true;
      }
    } while (next_permutation(ord.begin(), ord.end()));
    if (!flag) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
