#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n;
  cin >> n;
  vector<ll> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a.begin(), a.end());
  if (*max_element(a.begin(), a.end()) == 0) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3) {
    cout << "No" << endl;
    return 0;
  }
  map<ll, ll> mp;
  for (int i = 0; i < n; i++) mp[a[i]]++;
  if (mp.size() >= 4 || mp.size() == 1) {
    cout << "No" << endl;
    return 0;
  }
  if (mp.size() == 3) {
    vector<int> v;
    for (auto x : mp) v.push_back(x.first);
    if (mp[v[0]] == n / 3 && mp[v[1]] == n / 3 && v[0] ^ v[1] == v[2]) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  if (mp.size() == 2) {
    if (mp[0] == n / 3) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}
