#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) cin >> a[i];
  bool ac = true;
  for (long long i = 0; i < n; i++) {
    if (i == 0) {
      if ((a[n - 1] ^ a[1]) != a[0]) ac = false;
    } else if (i == n - 1) {
      if ((a[n - 2] ^ a[0]) != a[n - 1]) ac = false;
    } else if (i > 0 && i < n - 1) {
      if ((a[i + 1] ^ a[i - 1]) != a[i]) ac = false;
    }
  }
  if (ac == false)
    cout << "No" << endl;
  else
    cout << "Yes" << endl;
  return 0;
}
