#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double EPS = 1e-10;
const ll MOD = 7 + (1e+9);
int main() {
  ll n;
  cin >> n;
  ll f = 0;
  vector<ll> v(n, 0);
  set<ll> st;
  multiset<ll> s;
  for (ll i = 0; i < n; i++) {
    cin >> v[i];
    st.insert(v[i]);
    s.insert(v[i]);
  }
  if (n == 3) {
    ll ff = 0;
    for (ll i = 0; i < 3; i++) {
      if ((v[i] ^ v[(i + 1) % 3]) != v[(i + 2) % 3]) ff = 1;
    }
    if (ff == 0) f = 1;
  } else {
    if (st.size() == 1 && v[0] == 0) {
      f = 1;
    }
    if ((n % 3) == 0) {
      if (st.size() == 3) {
        ll ff = 0;
        vector<ll> vv(3, 0);
        auto itr = st.begin();
        for (ll j = 0; j < 3; j++) {
          vv[j] = *itr;
          itr++;
        }
        for (ll i = 0; i < 3; i++) {
          if ((vv[i] ^ vv[(i + 1) % 3]) != vv[(i + 2) % 3]) ff = 1;
        }
        if (ff == 0) {
          ll fff = 0;
          for (ll j = 0; j < 3; j++) {
            if (ll(s.count(v[j])) != (n / 3)) fff = 1;
          }
          if (fff == 0) f = 1;
        }
      } else if (st.size() == 2) {
        if (*st.begin() == 0) {
          if (ll(s.count(*st.begin())) != (n / 3) ||
              ll(s.count(*st.begin())) != (2 * n / 3))
            f = 1;
        }
      }
    }
  }
  if (f == 1)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
