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