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