#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000007;
int main() {
  int N;
  cin >> N;
  int A[N];
  for (int i = 0; i < N; i++) cin >> A[i];
  sort(A, A + N);
  if (A[0] == 0 && A[N - 1] == 0) {
    cout << "Yes" << endl;
    return 0;
  }
  if (N % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  if (A[0] == A[N / 3 - 1] && A[N / 3] == A[2 * N / 3 - 1] &&
      A[2 * N / 3] == A[N - 1]) {
    if (A[0] ^ A[N / 3] ^ A[2 * N / 3] == 0) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}
