#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < (N); i++) cin >> a[i];
  sort(a.begin(), a.end());
  vector<pair<int, int>> x;
  x.push_back(make_pair(a[0], 0));
  for (int i = 0; i < (N); i++) {
    if (x.back().first != a[i]) {
      x.push_back(make_pair(a[i], 1));
    } else {
      x.back().second++;
    }
  }
  if (x.size() == 3 && ((x[0].first ^ x[1].first) == x[2].first) &&
      N % 3 == 0 && x[1].second == x[2].second && x[1].second == x[0].second)
    cout << "Yes" << endl;
  else if (x.size() == 2 && x[0].first * x[1].first == 0 && N % 2 == 0 &&
           x[1].second == x[0].second)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
