#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<long long> vec(n);
  set<long long> st;
  for (int i = 0; i < n; i++) {
    cin >> vec[i];
    st.insert(vec[i]);
  }
  vector<long long> tmp;
  for (auto &e : st) {
    tmp.push_back(e);
  }
  bool flag = false;
  if (tmp.size() == 1 && tmp[0] == 0) flag = true;
  if (n % 3 == 0 && tmp.size() == 3) {
    long long a = tmp[0], b = tmp[1], c = tmp[2];
    long long d = a ^ b;
    if (c == d) {
      sort(vec.begin(), vec.end());
      long long cnt_a = upper_bound(vec.begin(), vec.end(), a) -
                        lower_bound(vec.begin(), vec.end(), a);
      long long cnt_b = upper_bound(vec.begin(), vec.end(), b) -
                        lower_bound(vec.begin(), vec.end(), b);
      long long cnt_c = upper_bound(vec.begin(), vec.end(), c) -
                        lower_bound(vec.begin(), vec.end(), c);
      if (cnt_a == (n / 3) && cnt_b == (n / 3) && cnt_c == (n / 3)) flag = true;
    }
  }
  cout << (flag ? "Yes" : "No");
}
