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