#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<long long int> a(N);
  for (int i = 0; i < N; i++) {
    cin >> a[N];
  }
  string ans = "Yes";
  for (int i = 1; i < N - 1; i++) {
    if (a[i - 1] ^ a[i + 1] != a[i]) {
      ans = "No";
    }
  }
  if (a[0] != a[1] ^ a[N - 1]) {
    ans = "No";
  }
  if (a[N - 1] != a[0] ^ a[N - 2]) {
    ans = "No";
  }
  cout << ans << endl;
}
