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