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