#include <bits/stdc++.h>
using namespace std;
int N, a[101010];
int main() {
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
  }
  sort(a, a + N);
  if (N == 3) {
    bool done = false;
    do {
      bool ok = true;
      for (int i = 0; i < N; i++) {
        ok &= (a[(i - 1 + N) % N] ^ a[(i + 1 + N) % N]) == a[i];
      }
      if (ok) {
        done = true;
        break;
      }
    } while (next_permutation(a, a + N));
    cout << (done ? "Yes" : "No") << '\n';
  } else {
    cout << (a[0] == a[N - 1] ? "Yes" : "No") << '\n';
  }
}
