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