#include <bits/stdc++.h>
using namespace std;
int main() {
  long int i, j, n, c = 0;
  cin >> n;
  long int a[n + 2];
  if (n > 3) {
    cout << "No";
    exit(0);
  }
  for (i = 0; i < n; i++) cin >> a[i];
  if (n == 3) {
    a[-1] = a[n - 1];
    a[n] = a[0];
    for (i = 0; i < n; i++) {
      if ((a[i - 1] ^ a[i + 1]) != a[i]) {
        c = 1;
        break;
      }
    }
  }
  if (c == 1)
    cout << "No";
  else
    cout << "Yes";
  return 0;
}
