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