#include <bits/stdc++.h>
using namespace std;
using Pll = pair<long long, long long>;
const long long INF = 1LL << 60;
const long long MOD = 1000000007;
int main() {
  long long N;
  cin >> N;
  vector<long long> A(N);
  for (int i = 0; i < N; i++) cin >> A[i];
  vector<long long> cxor(N);
  cxor[0] = A[0];
  for (int i = 1; i < N; i++) {
    cxor[i] = A[i] ^ cxor[i - 1];
  }
  bool jg = true;
  for (int i = 0; i < N; i++) {
    if ((cxor[i] ^ cxor[(i - 3 + N) % N]) != 0) {
      cout << "No" << endl;
      return 0;
    }
  }
  if ((cxor[2]) != 0) {
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
  return 0;
}
