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