#include <bits/stdc++.h>
using namespace std;
int n, a[100005], ans;
bool ok;
int main() {
  ok = true;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int b = a[n - 1];
  int c = a[1];
  int d = c ^ b;
  if (d != a[0]) {
    ok = false;
  }
  b = a[n - 2];
  c = a[0];
  d = b ^ c;
  if (d != a[n - 1]) {
    ok = false;
  }
  for (int i = 1; i < n - 1 && ok; i++) {
    int b = a[i - 1];
    int c = a[i + 1];
    int d = c ^ b;
    if (d != a[i]) {
      ok = false;
      break;
    }
  }
  if (ok) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
