#include <bits/stdc++.h>
using namespace std;
int main(void) {
  unsigned int n;
  vector<unsigned int> a;
  cin >> n;
  a.resize(n);
  for (int i = (0); i < (n); i++) cin >> a[i];
  sort(a.begin(), a.end());
  if ((n % 3 == 0 && a[0] == a[n / 3 - 1] && a[n / 3 - 1] != a[n / 3] &&
       a[n / 3] == a[(n / 3) * 2 - 1] && a[(n / 3) * 2 - 1] != a[(n / 3) * 2] &&
       a[(n / 3) * 2] == a[n - 1] && (a[0] ^ a[n / 3]) == a[n - 1]))
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
