#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  auto a = vector<long long>(n, 0);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int count = 0;
  for (int i = 0; i < n; i++) {
    if (i == 0) {
      if (a[i] == (a[n - 1] ^ a[1])) count++;
    } else if (i == n - 1) {
      if (a[i] == (a[n - 2] ^ a[0])) count++;
    } else {
      if (a[i] == (a[i - 1] ^ a[i + 1])) {
        count++;
      }
    }
  }
  if (count == a.size()) {
    cout << "Yes";
  } else {
    cout << "No";
  }
}
