#include <bits/stdc++.h>
using namespace std;
int n;
bool solve() {
  int i, j;
  string str;
  cin >> n;
  vector<int> a(n);
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  vector<pair<int, int> > ct;
  ct.push_back(make_pair(a[0], 1));
  for (i = 1; i < n; i++) {
    if (a[i] == a[i - 1])
      ct[ct.size() - 1].second += 1;
    else
      ct.push_back(make_pair(a[i], 1));
  }
  if (ct.size() == 3 && n % 3 == 0) {
    if (ct[0].second == ct[1].second && ct[1].second == ct[2].second &&
        ct[0].first ^ ct[1].first == ct[2].first)
      return true;
  }
  if (ct.size() == 2 && n % 3 == 0) {
    if (ct[0].second * 2 == ct[1].second && ct[0].first == 0) return true;
  }
  if (ct.size() == 1 && ct[0].first == 0) return true;
  return false;
}
int main() {
  if (solve())
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
