#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int a[100000];
  int ok = 0;
  for (int i = 0; i < N; i++) cin >> a[i];
  do {
    for (int j = 0; j < N; j++) {
      int i = 1;
      int temp = 0;
      for (i; i < N - 1; i++) {
        if (a[i] == (a[i - 1] ^ a[i + 1])) {
          temp++;
          continue;
        } else {
          break;
        }
      }
      if (a[0] == (a[N - 1] ^ a[1])) {
        temp++;
      }
      if (a[N - 1] == (a[0] ^ a[N - 2])) {
        temp++;
      }
      if (temp == N) {
        ok = 1;
        break;
      }
    }
    if (ok == 1) {
      cout << "Yes" << endl;
      break;
    }
  } while (next_permutation(a, a + N));
  if (ok == 0) {
    cout << "No" << endl;
  }
  return 0;
}
