#include <bits/stdc++.h>
using namespace std;
void Debug() { cerr << '\n'; }
template <class FIRST, class... REST>
void Debug(FIRST arg, REST... rest) {
  cerr << arg << " ";
  Debug(rest...);
}
template <class T>
ostream& operator<<(ostream& out, const vector<T>& v) {
  out << "[";
  if (!v.empty()) {
    for (int i = int(0); i < int((int)(v).size() - 1); i++) out << v[i] << ", ";
    out << v.back();
  }
  out << "]";
  return out;
}
template <class S, class T>
ostream& operator<<(ostream& out, const pair<S, T>& v) {
  out << "(" << v.first << ", " << v.second << ")";
  return out;
}
const int MAX_N = 500010;
const int MAX_V = 100010;
const double eps = 1e-6;
const long long mod = 1000000007;
const int inf = 1 << 30;
const long long linf = 1LL << 60;
const double PI = 3.14159265358979323846;
mt19937 rng;
int N;
void solve() {
  cin >> N;
  if (N % 3 != 0) {
    cout << "No\n";
    return;
  }
  multiset<int> S;
  for (int i = int(0); i < int(N); i++) {
    int a;
    cin >> a;
    S.insert(a);
  }
  vector<int> vec;
  for (int i = int(0); i < int(3); i++) {
    int a = *S.begin();
    vec.push_back(a);
    for (int j = int(0); j < int(N / 3); j++) {
      if (!S.count(a)) {
        cout << "No\n";
        return;
      }
      S.erase(S.lower_bound(a));
    }
  }
  if ((vec[0] ^ vec[1]) == vec[2])
    cout << "Yes\n";
  else
    cout << "No\n";
}
uint32_t rd() {
  uint32_t res;
  res = std::random_device()();
  return res;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed;
  cout.precision(20);
  cerr << fixed;
  cerr.precision(6);
  rng.seed(rd());
  solve();
  cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
  return 0;
}
