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