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