#include <bits/stdc++.h>
using namespace std;
void MAIN() {
  long long n;
  cin >> n;
  if (n % 3) {
    cout << "No" << '\n';
    return;
  }
  vector<long long> a(n);
  for (auto &i : a) cin >> i;
  sort((a).begin(), (a).end());
  long long t = n / 3;
  if (a[0] == 0 && a[t] == 0 && a[t * 2]) {
    cout << "No" << '\n';
    return;
  }
  for (long long i = 0; i < t; i++) {
    if ((a[i] ^ a[i + t]) != a[i + t * 2]) {
      cout << "No" << '\n';
      return;
    }
    if (i && (a[i] != a[i - 1] || a[i + t] != a[i + t - 1])) {
      cout << "No" << '\n';
      return;
    }
  }
  cout << "Yes" << '\n';
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long T = 1;
  while (T--) MAIN();
}
