#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  bitset<1000000000> value;
  bool flag = false;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int j = 1; j < n; j++) {
    bitset<1000000000> xor_bits =
        bitset<1000000000>(a[j - 1]) ^ bitset<1000000000>(a[j + 1]);
    if (xor_bits == a[j]) flag = true;
  }
  bitset<1000000000> xor_bits =
      bitset<1000000000>(a[1]) ^ bitset<1000000000>(a[n]);
  if (xor_bits == bitset<1000000000>(a[0])) flag = true;
  if (flag)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
