#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int64_t> a(N);
  for (int i = 0; i < N; ++i) {
    cin >> a[i];
  }
  bool result = true;
  for (int i = 0; i < N; ++i) {
    int64_t x = a[(i - 1 + N) % N] ^ a[(i + 1) % N];
    if (x != a[i]) {
      result = false;
      break;
    }
  }
  cout << (result ? "Yes" : "No") << endl;
}
