#include <bits/stdc++.h>
using namespace std;
map<int, int> m;
vector<pair<int, int> > pairs;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int v;
    cin >> v;
    m[v]++;
  }
  for (auto it : m) {
    pairs.emplace_back(it.first, it.second);
  }
  if (pairs.size() == 3 && pairs[0].second == pairs[1].second &&
      pairs[1].second == pairs[2].second &&
      (pairs[0].first ^ pairs[1].first == pairs[2].first)) {
    cout << "Yes" << endl;
  } else if (pairs.size() == 1 && pairs[0].first == 0) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
