#include <bits/stdc++.h>
using namespace std;
bool checkCamel(int);
int N;
int* a;
int main(void) {
  cin >> N;
  a = new int[N];
  for (int i = 0; i < N; i++) {
    cin >> a[i];
  }
  for (int i = 1; i < N; i++) {
    if (checkCamel(i)) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}
bool checkCamel(int nextIndex) {
  bool* cap = new bool[N];
  int* camelCap = new int[N];
  for (int i = 0; i < N; i++) {
    cap[i] = false;
    camelCap[i] = -1;
  }
  cap[0] = true;
  cap[nextIndex] = true;
  camelCap[0] = a[0];
  camelCap[1] = a[nextIndex];
  for (int i = 2; i < N; i++) {
    int xorNum = camelCap[i - 1] ^ camelCap[i - 2];
    for (int j = 0; j < N; j++) {
      if (cap[j]) continue;
      if (a[j] == xorNum) {
        cap[j] = true;
        camelCap[i] = a[j];
        break;
      }
    }
    if (camelCap[i] < 0) return false;
  }
  if ((camelCap[N - 2] ^ camelCap[N - 1]) != camelCap[0] ||
      (camelCap[N - 1] ^ camelCap[0]) != camelCap[1]) {
    return false;
  }
  return true;
}
