#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  bool ok = true;
  for (long long i = 1; i < n - 1; i++) {
    if (a[i] != (a[i + 1] ^ a[i - 1])) {
      ok = false;
      break;
    }
  }
  if (a[0] != (a[n - 1] ^ a[1])) ok = false;
  if (a[n - 1] != (a[n - 2] ^ a[0])) ok = false;
  if (ok)
    cout << "Yes";
  else
    cout << "No";
  return 0;
}
