#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long a[100001];
  for (long long k = 0; k <= 100000; k++) {
    a[k] = 0;
  };
  long long tmp;
  map<long long, long long> m;
  for (long long i = 0; i < (long long)(n); i++) {
    cin >> tmp;
    if (m.find(tmp) == m.end()) {
      m[tmp] = 0;
    }
    m[tmp]++;
  }
  if (m.size() == 1 && m.find(0) != m.end()) {
    cout << "Yes" << endl;
  } else if (m.size() == 2 && m.find(0) != m.end() && n == 3 * m[0]) {
    cout << "Yes" << endl;
  } else if (m.size() > 3) {
    cout << "No" << endl;
  } else if (m.size() == 3) {
    vector<long long> v;
    set<long long> st;
    for (auto e : m) {
      v.push_back(e.first);
      st.insert(e.second);
    }
    if (st.size() != 1) {
      cout << "No" << endl;
    } else {
      if (v[0] ^ v[1] == v[2] && v[0] ^ v[2] == v[1] && v[1] ^ v[2] == v[0]) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    }
  } else {
    cout << "No" << endl;
  }
  return 0;
}
