#include <bits/stdc++.h>
using namespace std;
const long long INF = 1l << 60;
long long N;
long long A[100100];
bool used[100100];
signed main() {
  cin >> N;
  for (long long i = 0; i < (N); ++i) {
    cin >> A[i];
  }
  sort(A, A + N);
  long long first = A[0];
  for (long long i = 1; i < N; ++i) {
    if (i == 2) break;
    long long second = A[i];
    for (long long j = 0; j < (N); ++j) {
      long long idx = lower_bound(A, A + N, first ^ second) - A;
      while (1) {
        if (A[idx] != (first ^ second)) {
          goto ng;
        }
        if (used[idx])
          idx++;
        else {
          used[idx] = true;
          break;
        }
      }
      long long third = first ^ second;
      first = second;
      second = third;
    }
    cout << "Yes" << endl;
    return 0;
  ng:;
    memset(used, 0, sizeof(used));
  }
  cout << "No" << endl;
  return 0;
}
