#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  map<long long, long long> init;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    init[a[i]]++;
  }
  a.push_back(a.front());
  map<long long, long long> xini;
  for (long long i = 0; i < n; i++) {
    long long x = a[i] ^ a[i + 1];
    xini[x]++;
  }
  if (init == xini)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
