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