#include <bits/stdc++.h>
using namespace std;
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long N;
  cin >> N;
  vector<long long> A(N);
  bool F = true;
  for (long long i = 0; i < N; i++) {
    cin >> A[i];
  }
  for (long long i = (1); i < (N - 1); ++i) {
    if (A[i - 1] ^ A[i + 1] != A[i]) {
      F = false;
    }
  }
  long long S = A[N - 1] ^ A[1];
  long long SS = A[N - 2] ^ A[0];
  if (S != A[0]) F = false;
  if (SS != A[N - 1]) F = false;
  if (F) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
