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