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