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