#include <bits/stdc++.h>
using ll = long long int;
static const ll mod = 1e9 + 7;
static const ll INF = 1LL << 50;
using namespace std;
int main() {
  ll n;
  cin >> n;
  vector<ll> a(n);
  map<int, int> mp;
  for (int i = (int)0; i < (int)n; ++i) {
    cin >> a[i];
    mp[a[i]]++;
  }
  sort(a.begin(), a.end());
  if (a[0] == 0 && a[n - 1] == 0)
    cout << "Yes\n";
  else if (n % 3 == 0) {
    if (mp.size() == 2) {
      if (mp[0] * 2 == mp[a[n / 3]])
        cout << "Yes\n";
      else
        cout << "No\n";
    } else if (mp.size() == 3) {
      if (a[0] ^ a[n / 3] ^ a[n / 3 * 2] == 0 && mp[a[0]] == mp[a[n / 3]] &&
          mp[a[n / 3]] == mp[a[n / 3 * 2]])
        cout << "Yes\n";
    } else
      cout << "No\n";
  } else {
    cout << "No\n";
  }
  return 0;
}
