#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int z = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] == 0) {
      z++;
    }
  }
  if (z == n) {
    cout << "Yes" << endl;
    return 0;
  }
  set<int> st;
  for (int i = 0; i < n; i++) {
    st.insert(a[i]);
  }
  if (st.size() >= 4 || st.size() <= 1) {
    cout << "No" << endl;
    return 0;
  }
  if (st.size() == 2 && z == n / 3) {
    cout << "Yes" << endl;
    return 0;
  }
  map<int, int> mp;
  for (int i = 0; i < n; ++i) {
    mp[a[i]]++;
  }
  if (st.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;
    }
  }
  cout << "No" << endl;
  return 0;
}
