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