#include <bits/stdc++.h>
using namespace std;
typedef int def;
template <typename T>
std::ostream& operator<<(std::ostream& out, const std::vector<T>& v) {
  if (!v.empty()) {
    std::copy(v.begin(), v.end(), std::ostream_iterator<T>(out, " "));
  }
  return out;
}
template <typename T>
std::ostream& operator<<(std::ostream& out, const std::set<T>& v) {
  if (!v.empty()) {
    std::copy(v.begin(), v.end(), std::ostream_iterator<T>(out, " "));
  }
  return out;
}
const int N = 1e5 + 10;
int A[N];
map<int, int> M;
vector<int> V;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (def i = 0; i < (n); i++) {
    int tp;
    cin >> tp;
    M[tp]++;
  }
  for (auto i : M) V.push_back(i.first);
  if (V.size() > 3) {
    cout << "No";
  } else if (V.size() == 1) {
    if (V[0] == 0)
      cout << "Yes";
    else
      cout << "No";
  } else if (V.size() == 2) {
    if (V[0] == 0) {
      if (M[V[1]] == 2 * M[V[0]])
        cout << "Yes";
      else
        cout << "No";
    } else if (V[1] == 0) {
      if (M[V[0]] == 2 * M[V[1]])
        cout << "Yes";
      else
        cout << "No";
    } else
      cout << "No";
  } else {
    if (V[0] ^ V[1] ^ V[2] == 0 && M[V[0]] == M[V[1]] && M[V[0]] == M[V[2]])
      cout << "Yes";
    else
      cout << "No";
  }
}
