#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long N;
  cin >> N;
  vector<long long> a(N);
  for (long long i = 0; i < N; i++) {
    cin >> a[i];
  }
  if (N % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  set<long long> st;
  for (long long i = 0; i < N; i++) {
    st.insert(a[i]);
  }
  if (st.size() != 3) {
    cout << "No" << endl;
    return 0;
  }
  map<long long, long long> cnt;
  for (long long i = 0; i < N; i++) {
    cnt[a[i]]++;
  }
  long long X = 0;
  for (auto p : cnt) {
    X ^= p.first;
    if (p.second != N / 3) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << (X == 0 ? "Yes" : "No") << endl;
  return 0;
}
