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