#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007LL;
const string alpha = "abcdefghijklmnopqrstuvwxyz";
int main() {
  int n;
  cin >> n;
  long a[n];
  set<long> st;
  map<long, int> mp;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    st.insert(a[i]);
    mp[a[i]]++;
  }
  if (n % 3 != 0 || st.size() > 3) {
    cout << "No" << endl;
    return 0;
  }
  if (st.size() == 1) {
    if (*st.begin() == 0) {
      cout << "Yes" << endl;
      return 0;
    } else {
      cout << "No" << endl;
      return 0;
    }
  }
  if (st.size() == 2) {
    auto itrr = st.begin();
    long k = *itrr;
    itrr++;
    long w = *itrr;
    if (k != 0 && w != 0) {
      cout << "No" << endl;
      return 0;
    }
    if (mp[0] * 2 == mp[max(k, w)]) {
      cout << "Yes" << endl;
      return 0;
    } else {
      cout << "No" << endl;
      return 0;
    }
  }
  auto itr = st.begin();
  long p, q, r;
  p = *itr;
  itr++;
  q = *itr;
  itr++;
  r = *itr;
  if (mp[p] != mp[q] || mp[p] != mp[r] || mp[q] != mp[r]) {
    cout << "No" << endl;
    return 0;
  }
  if (p ^ q == r) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
