#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;
  for (ll i = 0; i < n; i++) {
    cin >> v[i];
    st.insert(v[i]);
  }
  if (n == 3) {
    ll ff = 0;
    ll i;
    for (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 ((n & 1) == 0) {
      if (st.size() == 2) {
        auto i1 = st.begin();
        auto i2 = st.begin();
        i2++;
        if ((*i1 ^ *i2) == 0) {
          f = 1;
        }
      }
    }
  }
  if (f == 1)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
