#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  const long long size = 100000;
  long long a[size] = {0};
  cin >> N;
  long long j = 0;
  for (j = 0; j < N; j++) {
    cin >> a[j];
  }
  long long i = 0;
  for (long long l = 0; l < N; l++) {
    for (long long k = 0; k < N; k++) {
      for (i = 0; i < N; i++) {
        long long serch = a[i];
        long long left;
        if (i == 0) {
          left = a[N - 1];
        } else {
          left = a[i - 1];
        }
        long long right;
        if (i == N - 1) {
          right = a[0];
        } else {
          right = a[i + 1];
        }
        if (serch == (right ^ left)) {
          cout << "Yes" << endl;
          return 0;
        }
      }
      long long tmp = a[l];
      if (k != N - 1) {
        a[l] = a[k + 1];
        a[k + 1] = tmp;
      } else {
        a[l] = a[0];
        a[0] = tmp;
      }
    }
  }
  cout << "No" << endl;
  return 0;
}
