#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]);
  }
  if (n % 3 != 0) {
    for (auto &e : vec) {
      if (e != 0) {
        cout << "No";
        return 0;
      }
    }
    cout << "Yes";
    return 0;
  }
  if (st.size() == 1) {
    if (vec[0] == 0) {
      cout << "Yes";
      return 0;
    }
    cout << "No";
    return 0;
  }
  if (st.size() != 3) {
    cout << "No";
    return 0;
  }
  vector<int> tmp;
  for (auto &e : st) {
    tmp.push_back(e);
  }
  int a = tmp[0], b = tmp[1], c = tmp[2];
  int d = a ^ c;
  if (d == b) {
    cout << "Yes";
    return 0;
  }
  cout << "No";
}
