#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
template <typename T, typename U>
ostream &operator<<(ostream &s, const pair<T, U> m) {
  cout << "(" << m.first << ", " << m.second << ")";
  return s;
}
template <typename T, typename U>
ostream &operator<<(ostream &s, const map<T, U> m) {
  ll c = 0;
  cout << "{ ";
  for (auto &(i) : (m)) cout << i << (c++ == m.size() - 1 ? " " : ", ");
  cout << "}";
  return s;
}
template <typename T>
ostream &operator<<(ostream &s, const vector<T> &v) {
  cout << "{ ";
  for (ll(i) = 0LL; (i) < (ll)(v.size()); (i)++)
    cout << v[i] << (i == v.size() - 1 ? " " : ", ");
  cout << "}";
  return s;
}
template <typename T>
ostream &operator<<(ostream &s, const list<T> &v) {
  ll c = 0;
  cout << "{ ";
  for (auto &(i) : (v)) cout << i << (c++ == v.size() - 1 ? " " : ", ");
  cout << "}";
  return s;
}
int main(void) {
  ll N;
  map<ll, ll> hats;
  cin >> N;
  for (ll(i) = 0LL; (i) < (ll)(N); (i)++) {
    ll temp;
    cin >> temp;
    hats[temp]++;
  }
  if (hats.size() == 1) {
    if (hats.find(0) == hats.end())
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  } else if (hats.size() == 2) {
    if (hats.find(0) != hats.end() && hats[0] == N / 3)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else if (hats.size() == 3) {
    auto iter = hats.begin();
    pair<ll, ll> x, y, z;
    x = *iter++;
    y = *iter++;
    z = *iter;
    if ((x.second == y.second && y.second == z.second) &&
        x.first ^ y.first ^ z.first == 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    cout << "No" << endl;
  }
  return 0;
}
