#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<ll> a(n);
  bool f0 = true;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] != 0) f0 = false;
  }
  if (f0) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  map<ll, int> cnt;
  for (ll x : a) cnt[x]++;
  if (cnt.size() > 3) {
    cout << "No" << endl;
  } else if (cnt.size() == 1) {
    cout << (a[0] == 0 ? "Yes" : "No") << endl;
  } else if (cnt.size() == 2) {
    vector<ll> v;
    for (auto& p : cnt) v.push_back(p.first);
    if (v[0] == 0) {
      cout << (cnt[v[1]] == cnt[v[0]] * 2 ? "Yes" : "No") << endl;
    } else if (v[1] == 0) {
      cout << (cnt[v[0]] == cnt[v[1]] * 2 ? "Yes" : "No") << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    vector<ll> v;
    for (auto& p : cnt) v.push_back(p.first);
    if (v[0] ^ v[1] == v[2]) {
      cout << ((cnt[v[0]] == cnt[v[1]] && cnt[v[1]] == cnt[v[2]]) ? "Yes"
                                                                  : "No")
           << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
