#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];
  }
  long long count = 0;
  for (long long i = 1; i < n - 1; i++) {
    if (a[i] == (a[i - 1] ^ a[i + 1])) {
      count++;
    } else {
      cout << "No" << endl;
      return 0;
    }
  }
  if (a[0] == (a[1] ^ a[n - 1])) {
    count++;
  }
  if (a[n - 1] == (a[n - 2] ^ a[0])) {
    count++;
  }
  cout << (count == n ? "Yes" : "No") << endl;
  return 0;
}
