#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;
const ll MOD = 1e9 + 7;
const ll LINF = 1LL << 60;
const int INF = 1e9 + 7;
int main() {
  ll n;
  cin >> n;
  map<ll, ll> mp;
  vector<ll> hat;
  for (ll i = 0; i < n; ++i) {
    ll a;
    cin >> a;
    if (mp.count(a) > 0) {
      mp[a]++;
    } else {
      hat.push_back(a);
      mp[a] = 1;
    }
  }
  if (hat.size() != 3 || n % 3 != 0) {
    cout << "No\n";
    return 0;
  } else {
    if (hat[0] == (hat[1] ^ hat[2]))
      cout << "Yes\n";
    else
      cout << "No\n";
  }
}
