#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < N; i++) cin >> a.at(i);
  vector<int> ai(N);
  ai.at(0) = a.at(0);
  for (int i = 1; i < N; i++) {
    ai.at(1) = a.at(i);
    for (int j = 2; j < N; j++) {
      ai.at(j) = a.at(j - 2) ^ a.at(j - 1);
    }
    if (a == ai) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}
