#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  cin >> N;
  long long A[N];
  set<long long> st;
  for (long long i = 0; i < N; i++) {
    cin >> A[i];
    st.insert(A[i]);
  }
  bool flg = true;
  if (N % 3 != 0) flg = false;
  if (st.size() != 3) flg = false;
  if (flg) {
    auto itr = st.begin();
    long long a = *itr;
    long long b = *(++itr);
    long long c = *(++itr);
    long long cnt_a = 0;
    long long cnt_b = 0;
    long long cnt_c = 0;
    for (long long i = 0; i < N; i++) {
      if (A[i] == a) cnt_a++;
      if (A[i] == b) cnt_b++;
      if (A[i] == c) cnt_c++;
    }
    if (cnt_a != N / 3) flg = false;
    if (cnt_b != N / 3) flg = false;
    if (cnt_c != N / 3) flg = false;
    if (a != (b ^ c)) flg = false;
    if (b != (a ^ c)) flg = false;
    if (c != (a ^ b)) flg = false;
  }
  if (st.size() == 1 && *st.begin() == 0) flg = true;
  if (flg) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
