#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<long long, long long>;
const long long INF = 1LL << 60;
const long long MOD = 1000000007;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
vector<long long> divisor(long long n) {
  vector<long long> ret;
  for (long long i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i * i != n) ret.push_back(n / i);
    }
  }
  sort(ret.begin(), ret.end());
  return ret;
}
ll nCr(ll n, ll r) {
  ll ans = 1;
  for (int i = n; i > n - r; --i) {
    ans = ans * i;
  }
  for (int i = 1; i < r + 1; ++i) {
    ans = ans / i;
  }
  return ans;
}
int main() {
  ll N;
  cin >> N;
  map<ll, ll> a;
  for (int i = 0; i < (int)(N); i++) {
    ll b;
    cin >> b;
    a[b]++;
  }
  vector<long long> vec(a.size());
  vector<long long> val(a.size());
  ll i = 0;
  for (auto p : a) {
    auto k = p.first;
    auto v = p.second;
    vec.at(i) = k;
    val.at(i) = v;
    i++;
  }
  sort((vec).begin(), (vec).end());
  if (a.size() > 3) {
    cout << "No" << endl;
  } else if (a.size() == 1) {
    if (vec.at(0) == 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else if (a.size() == 2) {
    if (vec.at(0) ^ vec.at(0) == vec.at(1) && val.at(0) == val.at(1)) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    sort((val).begin(), (val).end());
    if (vec.at(0) ^ vec.at(1) == vec.at(2) && N % 3 == 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}
