#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = double;
using P = pair<ll, ll>;
using T = tuple<ll, ll, ll>;
const ll INF = 1e17;
const ld eps = 1e-10;
const ll MOD = 1e9 + 7;
const double pi = acos(-1.0);
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll N;
  cin >> N;
  map<ll, ll> cnt;
  for (int i = 0; i < N; i++) {
    ll a;
    cin >> a;
    if (cnt.find(a) == cnt.end())
      cnt[a] = 1;
    else
      cnt[a]++;
  }
  bool ans = false;
  if (cnt.size() == 1 && cnt.find(0) != cnt.end())
    ans = true;
  else if (cnt.size() == 3 && N % 3 == 0) {
    ans = true;
    vector<ll> el;
    for (auto i : cnt) {
      if (i.second != N / 3) ans = false;
      el.push_back(i.first);
    }
    if (el[0] ^ el[1] != el[2]) ans = false;
  }
  if (ans)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
