#include <bits/stdc++.h>
using namespace std;
int search(vector<int> &a, int cammel) {
  int size = a.size();
  for (int i = 0; i < size; i++) {
    if (a[i] == cammel) {
      a[i] == -1;
      return i;
    }
  }
  return -1;
}
int main(int argc, char *argv[]) {
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < N; i++) {
    cin >> a[i];
  }
  bool boolean = true;
  for (int cam = 1; cam < N; cam++) {
    vector<int> cammel(N);
    vector<int> aa = a;
    cammel[0] = aa[0];
    cammel[1] = aa[cam];
    boolean = true;
    for (int i = 2; i < N; i++) {
      cammel[i] = cammel[i - 2] xor cammel[i - 1];
      int res = search(aa, cammel[i]);
      if (res == -1) {
        boolean = false;
        ;
        if (false) printf("falsed in %d\n", 38);
        ;
        break;
      }
    }
    if (boolean) {
      if (cammel[N - 1] != (cammel[0] xor cammel[N - 2])) {
        boolean = false;
      }
      if (boolean) break;
    }
  }
  if (boolean)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
