#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];
  if ((hat[1] ^ hat[N - 1]) != hat[0]) {
    cout << "No" << endl;
    return 0;
  }
  for (int i = 1; i < N - 1; i++) {
    long long mid = hat[i - 1] ^ hat[i + 1];
    if (mid != hat[i]) {
      cout << "No" << endl;
      return 0;
    }
  }
  if ((hat[N - 2] ^ hat[0]) != hat[N - 1]) {
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
  return 0;
}
