#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];
  }
  bool yes = true;
  for (int i = 1; i < n - 1; i++) {
    int x = a[i - 1] ^ a[i + 1];
    if (x != a[i]) {
      yes = false;
      break;
    } else {
      yes = true;
    }
  }
  if (yes == true) {
    int x = a.front() ^ a.back();
    if (x == a[1]) cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
