#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 (mp.size() == 2) {
    if (mp[0] * 2 == mp[a[n - 1]])
      cout << "Yes\n";
    else
      cout << "No\n";
  } else {
    if (n % 3 == 0 && mp.size() == 3 && (a[0] ^ a[n - 1] ^ a[n / 3] == 0))
      cout << "Yes\n";
    else
      cout << "No\n";
  }
  return 0;
}
