#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  map<int, int> r;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    r[a] += 1;
  }
  vector<pair<int, int> > q;
  for (auto v : r) {
    q.push_back(v);
  }
  if (q.size() == 3 && q[0].second == q[1].second &&
      q[0].second == q[2].second &&
      (q[0].first ^ q[1].first ^ q[2].first) == 0) {
    cout << "Yes" << '\n';
  } else {
    cout << "No" << '\n';
  }
}
