#include <bits/stdc++.h>
using namespace std;
const int INF = (1 << 30) - 1;
const long long LLINF = (1LL << 60LL);
const int MOD = 1000000007;
const int MAX = 510000;
const double pi = acos(-1);
const double eps = 1e-9;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  long long n, a[100010];
  cin >> n;
  set<long long> st;
  map<long long, long long> make_pair;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    st.insert(a[i]);
    make_pair[a[i]]++;
  }
  if (make_pair.size() == 1) {
    if (make_pair[0] == n)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else if (make_pair.size() == 2) {
    if (n % 3 != 0)
      cout << "No" << endl;
    else if (make_pair[0] = n / 3) {
      auto itr = st.begin();
      itr++;
      if (make_pair[*itr] == n / 3 * 2)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    } else
      cout << "No" << endl;
  } else if (make_pair.size() == 3) {
    if (n % 3 != 0)
      cout << "No" << endl;
    else {
      auto itr = st.begin();
      long long b = *itr;
      itr++;
      long long c = *itr;
      itr++;
      long long d = *itr;
      if (make_pair[b] == n / 3 && make_pair[c] == n / 3 && (b ^ c == d)) {
        cout << "Yes" << endl;
      } else
        cout << "No" << endl;
    }
  } else
    cout << "No" << endl;
  return 0;
}
