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