#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < N; ++i) {
    cin >> a[i];
  }
  int flag = 0;
  sort(a.begin(), a.end());
  if (N % 3 != 0) {
    if (a.back() == 0) flag = 1;
  } else {
    if (a[0] == a[N / 3 - 1] && a[N / 3] == a[(N / 3) * 2 - 1]) {
      if (a[(N / 3) * 2] == a[N - 1] && a[0] ^ a[N / 3] == a[(N / 3) * 2])
        flag = 1;
    }
  }
  if (flag == 1) {
    cout << "Yes";
  } else {
    cout << "No";
  }
  return 0;
}
