#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using P = pair<ll, ll>;
template <class T>
using V = vector<T>;
int main() {
  int n;
  cin >> n;
  V<ll> a(n);
  for (int i = 0; i < (n); ++i) cin >> a[i];
  map<ll, int> m;
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  for (int i = 0; i < (n); ++i) m[a[i]]++;
  V<P> p;
  for (auto e : m) p.push_back({e.first, e.second});
  sort(p.begin(), p.end());
  bool ans = true;
  if (p.size() == 2) {
    ll sum = 0;
    for (auto e : p) {
      if (e.second == n / 3)
        sum ^= e.first;
      else if (e.second == n * 2 / 3)
        sum = sum ^ e.first ^ e.first;
      else
        ans = false;
    }
    ans = sum == 0;
  } else if (m.size() == 3) {
    for (auto e : m) {
      if (e.second != n / 3) ans = false;
    }
    ll sum = p[0].first ^ p[1].first;
    sum ^= p[2].first;
    if (sum != 0) ans = false;
  } else {
    ans = false;
  }
  if (ans) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
