#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.at(i);
  }
  if ((a.back() ^ a.at(1)) != a.at(0)) {
    cout << "No" << endl;
    return 0;
  }
  if ((a.at(0) ^ a.at(N - 2)) != a.back()) {
    cout << "No" << endl;
    return 0;
  }
  for (int i = 1; i < N - 1; i++) {
    if ((a.at(i - 1) ^ a.at(i + 1)) != a.at(i)) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
