#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;
const double pi = 3.14159265358979;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n;
  cin >> n;
  vector<ll> a(n);
  for (ll i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  map<ll, ll> mp;
  for (ll i = 0; i < n; i++) {
    mp[a[i]]++;
  }
  bool ans = false;
  if (mp.size() == 1) {
    if (a[0] == 0) {
      ans = true;
    }
  } else if (mp.size() == 2) {
    if (mp[0] == n / 3 && mp[a[n - 1]] == 2 * n / 3) {
      ans = true;
    }
  } else if (mp.size() == 3) {
    ll x = 0;
    for (auto p : mp) {
      auto k = p.first;
      x = x ^ k;
    }
    if (x == 0) {
      ans = true;
    }
  }
  if (ans) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  };
}
