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