#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> a;
  int n;
  int i, j;
  int s = 1;
  cin >> n;
  for (i = 0; i < n; i++) {
    int an;
    cin >> an;
    a.emplace_back(an);
  }
  int e;
  for (i = 1; i < n; i++) {
    e = a.at(i - 1) ^ a.at(i + 1);
    if (e != a.at(i)) {
      s = 0;
      break;
    }
  }
  if (a.at(0) != a.at(1) ^ a.at(i)) {
    s = 0;
  }
  if (a.at(i) != a.at(0) ^ a.at(i - 1)) {
    s = 0;
  }
  if (s == 1) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
