#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  map<int, int> mp;
  bool flag = 1;
  set<int> st;
  for (int i = 0; i < (int)(n); ++i) {
    cin >> a[i];
    if (n % 3 != 0) {
      if (a[i] != 0) {
        flag = 0;
      }
    }
    st.insert(a[i]);
    mp[a[i]]++;
  }
  if (!flag) {
    cout << "No" << endl;
    return 0;
  }
  if (mp.size() >= 4 || mp.size() == 2) {
    cout << "No" << endl;
    return 0;
  }
  vector<int> v;
  for (auto x : st) {
    v.push_back(x);
  }
  if (v.size() == 1) {
    if (v[0] != 0) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  } else {
    if ((v[0] ^ v[1]) != v[2]) {
      cout << "No" << endl;
      return 0;
    }
    if (mp[v[0]] == mp[v[1]] && mp[v[1]] == mp[v[2]]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
