#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Pll = pair<ll, ll>;
using Pii = pair<int, int>;
constexpr ll MOD = 1000000007;
constexpr long double EPS = 1e-10;
constexpr int dyx[4][2] = {{0, 1}, {-1, 0}, {0, -1}, {1, 0}};
int main() {
  std::ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  set<int> st;
  map<int, int> mp;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    ++mp[a[i]];
    st.insert(a[i]);
  }
  if (mp[0] == n) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3 == 0) {
    auto itr = st.begin();
    if (st.size() == 1) {
      ll x = *itr;
      if (x == 0) {
        cout << "Yes" << endl;
        return 0;
      }
    } else if (st.size() == 2) {
      ll x = *itr;
      ++itr;
      ll y = *itr;
      if (x > y) swap(x, y);
      if (x == 0 && mp[x] * 2 == mp[y]) {
        cout << "Yes" << endl;
        return 0;
      }
    } else if (st.size() == 3) {
      ll x = *itr;
      ++itr;
      ll y = *itr;
      ++itr;
      ll z = *itr;
      if (x > y) swap(x, y);
      if (y > z) swap(y, z);
      if (x > z) swap(x, z);
      if ((x ^ y) == z) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
  return 0;
}
