#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr long long MOD = 1000000007;
constexpr long long INF = 1LL << 60;
const long double PI = acosl(-1.0);
constexpr long double EPS = 1e-11;
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;
}
int main() {
  ll n;
  cin >> n;
  map<ll, ll> mp;
  for (ll i = 0; i < n; i++) {
    ll t;
    cin >> t;
    mp[t]++;
  }
  if (mp[0] == n and mp.size() == 1)
    cout << "Yes" << endl;
  else if (mp.size() == 2 and n % 3 == 0 and mp[0] == n / 3) {
    for (auto i : mp) {
      if (i.first == 0) continue;
      if (i.second == 2 * n / 3) {
        cout << "Yes" << endl;
      } else
        cout << "No" << endl;
    }
  } else if (mp.size() == 3) {
    ll a = 0;
    for (auto i : mp) a ^= i.first;
    ll k[3];
    ll i = 0;
    for (auto itr = mp.begin(); itr != mp.end(); itr++) {
      k[i] = itr->second;
      i++;
    }
    if (a == 0 and k[0] == k[1] and k[1] == k[2])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else
    cout << "No" << endl;
}
