#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.at(i);
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
  } else {
    sort(a.begin(), a.end());
    for (int i = 0; i < n / 3 - 1; i++) {
      if (a.at(i) != a.at(i + 1)) {
        cout << "No" << endl;
        return 0;
      }
    }
    for (int i = n / 3; i < 2 * n / 3 - 1; i++) {
      if (a.at(i) != a.at(i + 1)) {
        cout << "No" << endl;
        return 0;
      }
    }
    for (int i = 2 * n / 3; i < n - 1; i++) {
      if (a.at(i) != a.at(i + 1)) {
        cout << "No" << endl;
        return 0;
      }
    }
    if (a.at(n / 3 - 1) == a.at(n / 3) ||
        a.at(2 * n / 3 - 1) == a.at(2 * n / 3)) {
      cout << "No" << endl;
    } else {
      int x = a.at(0) ^ a.at(n / 3);
      if (x == a.at(n * 2 / 3)) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    }
  }
  return 0;
}
