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