#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int64_t> a(n);
  bool result = true;
  for (int i = 0; i < n; i++) {
    cin >> a.at(i);
  }
  for (int i = 0; i < n - 2; i++) {
    int d = a.at(i) ^ a.at(i + 2);
    if (d != a.at(i + 1)) {
      for (int j = i + 3; j < n; j++) {
        if (d == a.at(j)) {
          int n = a.at(i + 1);
          a.at(i + 1) = a.at(j);
          a.at(j) = n;
          break;
        }
        result = false;
        break;
      }
    }
  }
  if (result)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
