#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  unsigned a[N];
  unsigned b[N];
  int i;
  int j;
  for (i = 0; i < N; ++i) {
    cin >> a[i];
  }
  b[0] = a[0];
  int check;
  int k;
  int l;
  int c = 0;
  for (i = 1; i < N; i++) {
    for (j = 1; j < N; j++) {
      check = 0;
      c = 0;
      if (a[0] ^ a[i] == a[j] && a[i] != a[j]) {
        b[1] = a[j];
        b[2] = a[i];
        for (k = 3; k < N; k++) {
          for (l = 1; l < N; l++) {
            if (b[k - 2] ^ a[l] == b[k - 1]) {
              b[k] = a[l];
              c++;
            }
          }
          if (c == 0) {
            check = -1;
            break;
          }
        }
        if (check == 0) {
          if (b[N - 2] ^ b[0] == b[N - 1]) cout << "Yes";
          break;
        }
      }
    }
  }
  if (check == -1) cout << "No";
  return 0;
}
