#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long N;
  cin >> N;
  vector<unsigned long> v(N);
  for (unsigned long i = 0; i < N; ++i) {
    cin >> v[i];
  }
  if (((v[1] ^ v[N - 1]) == v[0]) && ((v[0] ^ v[N - 2]) == v[N - 1])) {
    for (unsigned long i = 1; i < N - 1; ++i) {
      if (v[i] != (v[i - 1] ^ v[i + 1])) {
        cout << "No" << endl;
        return 0;
      }
    }
    cout << "Yes" << endl;
    return 0;
  } else {
    cout << "No" << endl;
    return 0;
  }
}
