#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double PI = 3.141592653589793238462643383279;
const ll MOD = 1e9 + 7;
const ll INF = 1LL << 55;
signed main() {
  ll N;
  cin >> N;
  map<ll, ll> m;
  for (ll i = 0; i < N; i++) {
    ll a;
    cin >> a;
    m[a]++;
  }
  if (m.size() > 3) {
    cout << "No" << endl;
    return 0;
  }
  vector<ll> vec;
  for (auto it = m.begin(); it != m.end(); it++) {
    vec.push_back(it->first);
  }
  if (m.size() == 3) {
    if (N % 3 == 0 && vec[0] ^ vec[1] == vec[2] && m[vec[0]] == m[vec[1]] &&
        m[vec[1]] == m[vec[2]]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else if (m.size() == 2) {
    ll x = vec[0];
    ll y = vec[1];
    if (m[y] > m[x]) swap(x, y);
    if (y != 0) {
      cout << "No" << endl;
      return 0;
    }
    throw "hoge";
    if (N % 3 == 0 && m[x] == 2 * m[y]) {
      cout << "Yes" << endl;
    } else if (N % 3 == 2 && (m[x] - 1) == 2 * (m[y] - 1)) {
      cout << "Yes" << endl;
    } else if (N % 3 == 1 && (m[x] - 1) == 2 * m[y]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    if (vec[0] == 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
