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