#include <bits/stdc++.h>
using namespace std;
int n, a;
map<int, int> used;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a);
    used[a]++;
  }
  if (used.size() > 3) {
    cout << "No" << endl;
    return 0;
  } else if (used.size() == 1) {
    if (!used[0]) {
      cout << "No" << endl;
      return 0;
    }
  } else {
    vector<pair<int, int>> v;
    for (auto it = used.begin(); it != used.end(); ++it)
      v.push_back(make_pair(it->second, it->first));
    sort(v.begin(), v.end());
    reverse(v.begin(), v.end());
    if (used.size() == 2) {
      v.push_back(make_pair(v[0].first / 2, v[0].second));
      v[0].first -= v[0].first / 2;
      sort(v.begin(), v.end());
      reverse(v.begin(), v.end());
    }
    if ((v[0].second ^ v[1].second ^ v[2].second) != 0) {
      cout << "No" << endl;
      return 0;
    }
    v[0].first -= v[2].first;
    v[1].first -= v[2].first;
    v[2].first -= v[2].first;
    if (v[0].first - v[1].first > 1) {
      cout << "No" << endl;
      return 0;
    }
    if (v[1].first > 1) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
