#include <bits/stdc++.h>
using namespace std;
mt19937_64 rang(
    chrono::high_resolution_clock::now().time_since_epoch().count());
int rng(int l) {
  uniform_int_distribution<int> uid(0, l - 1);
  return uid(rang);
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.precision(10);
  srand(chrono::high_resolution_clock::now().time_since_epoch().count());
  int n;
  cin >> n;
  std::map<int, int> mp;
  vector<int> a(n);
  for (int o = 0; o < n; o++) {
    cin >> a[o];
    mp[a[o]]++;
  }
  if (mp.size() == 1 && mp.begin()->first == 0) {
    cout << "Yes";
  } else if (mp.size() == 2 && n % 2 == 0 &&
             mp.begin()->second == mp.rbegin()->second &&
             mp.begin()->first == 0) {
    cout << "Yes";
  } else if (mp.size() == 3 && n % 3 == 0 &&
             mp.begin()->second == mp.rbegin()->second &&
             mp.begin()->second == (n / 3) &&
             mp.find(mp.begin()->first ^ mp.rbegin()->first) != mp.end() &&
             mp.find(0) == mp.end()) {
    cout << "Yes";
  } else {
    cout << "No";
  }
}
