#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j = 0, kind = 1;
  cin >> n;
  vector<int> a(n), count(n), x(n + 1);
  for (i = 0; i < n; i++) {
    cin >> a.at(i);
  }
  sort(a.begin(), a.end());
  x.at(0) = a.at(0);
  count.at(0) = 1;
  for (i = 1; i < n; i++) {
    if (a.at(i) != a.at(i - 1)) {
      kind++;
      j++;
      x.at(j) = a.at(i);
    }
    count.at(j)++;
  }
  if (j == 2 && count.at(0) == count.at(1) && count.at(1) == count.at(2) &&
      x.at(0) ^ x.at(1) == x.at(2)) {
    cout << "Yes" << endl;
  } else if (count.at(0) == n && x.at(0) == 0) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
