#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<long long> hat(N);
  for (int i = 0; i < N; i++) cin >> hat[i];
  do {
    if ((hat[1] ^ hat[N - 1]) != hat[0]) continue;
    long long a = hat[1] ^ hat[N - 1];
    bool fal = false;
    for (int i = 1; i < N - 1; i++) {
      long long mid = hat[i - 1] ^ hat[i + 1];
      if (mid != hat[i]) {
        fal = true;
        break;
      }
    }
    if (fal) continue;
    if ((hat[N - 2] ^ hat[0]) != hat[N - 1]) continue;
    cout << "Yes" << endl;
    return 0;
  } while (next_permutation(hat.begin() + 1, hat.end()));
  cout << "Yes" << endl;
  return 0;
}
