#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  a.push_back(a[0]);
  a.push_back(a[1]);
  bool ok = true;
  for (int i = 1; i < a.size() - 1; ++i) {
    if ((a[i - 1] ^ a[i + 1]) != a[i]) {
      ok = false;
      break;
    }
  }
  if (ok)
    puts("Yes");
  else
    puts("No");
  return 0;
}
