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