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