#include <bits/stdc++.h>
using namespace std;
const int MD = 1e9 + 7;
void dbg() { cerr << "\n"; }
template <typename T, typename... T2>
void dbg(const T& fst, const T2&... rst) {
  cerr << fst << ": ";
  dbg(rst...);
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int(i) = 0; (i) < (n); (i)++) cin >> a[i];
  bool ok = true;
  for (int(i) = (1); (i) < (n - 1); (i)++) {
    int zx = a[i - 1] ^ a[i + 1];
    if (zx != a[i]) ok = false;
  }
  int zx = a[n - 1] ^ a[1];
  if (a[0] != zx) ok = false;
  zx = a[n - 2] ^ a[0];
  if (a[n - 1] != zx) ok = false;
  if (ok)
    puts("Yes");
  else
    puts("No");
  return 0;
}
