#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  vector<int> vec, vec1;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    vec.emplace_back(a);
  }
  vec.emplace_back(vec[0]);
  for (int j = 1; j <= n; j++) {
    int co = vec[j - 1] ^ vec[j];
    vec1.emplace_back(co);
  }
  vec.pop_back();
  sort(vec.begin(), vec.end());
  sort(vec1.begin(), vec1.end());
  for (int k = 0; k < n; k++) {
    if (vec[k] != vec1[k]) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
