#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  sort(A.begin(), A.end());
  if (N % 3 != 0) {
    cout << ((A[0] == 0 && A[N - 1] == 0) ? "Yes" : "No") << '\n';
    return 0;
  }
  int M = N / 3;
  for (int i = 0; i < 3; i++) {
    if (A[i * M] != A[(i + 1) * M - 1]) {
      cout << "No" << '\n';
      return 0;
    }
  }
  cout << ((A[0] ^ A[M] ^ A[2 * M] == 0) ? "Yes" : "No") << '\n';
  return 0;
}
