#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i <= N - 1; ++i) cin >> a[i];
  sort(a.begin(), a.end());
  if (a[N - 1] == 0)
    cout << "Yes" << endl;
  else if (N % 3 == 0) {
    if (a[0] == 0 && a[N / 3] == 0 && a[N / 3] == a[N - 1])
      cout << "Yes" << endl;
    else 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] == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else
    cout << "No" << endl;
  return 0;
}
