#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 10;
int main() {
  int n;
  cin >> n;
  long long int a[MAX];
  for (int i = 0; i < n; i++) cin >> a[i];
  bool ok = true;
  for (int i = 1; i < n - 1; i++) {
    ok = ok & (a[i] == a[i - 1] ^ a[i + 1]);
  }
  ok = ok & (a[0] == a[1] ^ a[n - 1]);
  ok = ok & (a[n - 1] == a[n - 2] ^ a[0]);
  if (ok)
    cout << "Yes";
  else
    cout << "No";
}
