#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = (0); i < (N); i++) cin >> a[i];
  bool allzero = true;
  for (int i = (0); i < (N); i++) {
    if (a[i] != 0) allzero = false;
  }
  if (allzero) {
    cout << "Yes" << endl;
    return 0;
  }
  if (N % 3 > 0) {
    cout << "No" << endl;
    return 0;
  }
  sort(a.begin(), a.end());
  int k = N / 3;
  if (a[0] == 0) {
    if (a[k - 1] == 0 && a[k] == a[N - 1]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    if (a[k - 1] == a[0] && a[2 * k - 1] == a[k] && a[N - 1] == a[2 * k]) {
      if (a[0] ^ a[k] == a[2 * k] || a[0] ^ a[2 * k] == a[k] ||
          a[k] ^ a[2 * k] == a[0]) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    } else {
      cout << "No" << endl;
    }
  }
}
