#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  std::vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  if (n % 3 == 0) {
    for (int i = 0; i < n / 3; i++) {
      if (a[i] != a[0]) {
        cout << "No" << endl;
        return 0;
      }
    }
    for (int i = n / 3; i < n / 3 + n / 3; i++) {
      if (a[i] != a[n / 3]) {
        cout << "No" << endl;
        return 0;
      }
    }
    for (int i = n / 3 + n / 3; i < n; i++) {
      if (a[n / 3 + n / 3] != a[i]) {
        cout << "No" << endl;
        return 0;
      }
    }
    int m = a[0];
    int l = a[n / 3];
    int j = a[n / 3 + n / 3];
    if ((m ^ l) == j && (m ^ j) == l && (j ^ l) == m) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}
