#include <bits/stdc++.h>
using namespace std;
void swap(int a, int b, int ary[]) {
  int tmp = ary[a];
  ary[a] = ary[b];
  ary[b] = tmp;
}
int main(int argc, char *argv[]) {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  bool flag = false;
  for (int j = 0; j < n && !flag; j++) {
    for (int k = 0; k < n && !flag; k++) {
      swap(j, k, a);
      flag = true;
      for (int i = 0; i < n; i++) {
        int l = (i + (n - 1)) % n;
        int r = (i + 1) % n;
        if (a[i] != (a[l] ^ a[r])) {
          flag = false;
          break;
        }
      }
    }
  }
  cout << (flag ? "Yes" : "No") << endl;
}
