#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9;
const long long MAX = 100005;
const long long MOD = 1000000007;
template <typename T1, typename T2>
ostream &operator<<(ostream &s, const pair<T1, T2> &p) {
  return s << "(" << p.first << ", " << p.second << ")";
}
template <typename T>
ostream &operator<<(ostream &s, const vector<T> &v) {
  int len = v.size();
  for (int i = 0; i < len; ++i) {
    s << v[i];
    if (i < len - 1) s << "	";
  }
  return s;
}
template <typename T>
ostream &operator<<(ostream &s, const vector<vector<T>> &vv) {
  int len = vv.size();
  for (int i = 0; i < len; ++i) {
    s << vv[i] << endl;
  }
  return s;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n;
  cin >> n;
  vector<long long> v(n);
  for (long long i = (0); i < (n); i++) {
    cin >> v[i];
  }
  if (n % 3 != 0) {
    cout << ((false) ? "Yes" : "No") << endl;
    ;
    return 0;
  }
  sort(v.begin(), v.end());
  long long m = n / 3;
  if (v[0] != v[m - 1]) {
    cout << ((false) ? "Yes" : "No") << endl;
    ;
    return 0;
  }
  if (v[m] != v[m * 2 - 1]) {
    cout << ((false) ? "Yes" : "No") << endl;
    ;
    return 0;
  }
  if (v[m * 2] != v[m * 3 - 1]) {
    cout << ((false) ? "Yes" : "No") << endl;
    ;
    return 0;
  }
  if (v[0] ^ v[m] == v[m * 2] || v[m] ^ v[m * 2] == v[0] ||
      v[0] ^ v[2 * m] == v[m]) {
    cout << ((true) ? "Yes" : "No") << endl;
    ;
  } else {
    cout << ((false) ? "Yes" : "No") << endl;
    ;
  }
  return 0;
}
