#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
using LP = pair<ll, int>;
const ll MOD = 1000000007, MOD2 = 998244353;
int main() {
  int N;
  cin >> N;
  vector<ll> a(N);
  for (int i = 0; i < (N); i++) cin >> a.at(i);
  bool j = true;
  for (int i = 0; i < (N); i++) {
    if (a.at(i) != 0) j = false;
  }
  if (j) {
    cout << "Yes" << endl;
    return 0;
  }
  if (N % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  sort(a.begin(), a.end());
  for (int i = 0; i < (N - 1); i++) {
    if (i == N / 3 - 1 || i == 2 * N / 3 - 1) {
      continue;
    }
    if (a.at(i) != a.at(i + 1)) {
      cout << "No" << endl;
      return 0;
    }
  }
  ll A = a.at(0), B = a.at(N / 3 - 1), C = a.at(2 * N / 3 - 1);
  if (A ^ B == C)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
