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