#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
const ll INF = 1LL << 60;
const ll MOD = 1000000007;
template <class T>
bool chmax(T &a, const T &b) {
  return (a < b) ? (a = b, 1) : 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  return (b < a) ? (a = b, 1) : 0;
}
int main() {
  int n;
  cin >> n;
  vl a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  map<ll, int> ma;
  for (int i = 0; i < n; ++i) {
    ma[a[i]]++;
  }
  bool ok = true;
  if (ma.size() == 1) {
    if (ma.begin()->first == 0)
      cout << "Yes"
           << "\n";
    else
      cout << "No"
           << "\n";
    return 0;
  } else if (ma.size() == 2) {
    ll n1, n2, num;
    auto it = ma.begin();
    n1 = it->first;
    num = it->second;
    ++it;
    n2 = it->first;
    if (num != it->second) ok = false;
    if (!(n1 == 0 || n2 == 0)) ok = false;
  } else if (ma.size() != 3) {
    cout << "No"
         << "\n";
    return 0;
  } else {
    ll n1, n2, n3, num;
    auto it = ma.begin();
    n1 = it->first;
    num = it->second;
    ++it;
    n2 = it->first;
    if (num != it->second) ok = false;
    ++it;
    n3 = it->first;
    if ((n1 ^ n2) != n3) ok = false;
    if (num != it->second) ok = false;
  }
  if (ok)
    cout << "Yes"
         << "\n";
  else
    cout << "No"
         << "\n";
  return 0;
}
