#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vs = vector<string>;
using vc = vector<char>;
using vb = vector<bool>;
using vd = vector<double>;
vi dir = {-1, 0, 1, 0, -1, -1, 1, 1, -1};
int main() {
  ll n;
  cin >> n;
  map<ll, ll> mp;
  bool zero = true;
  for (ll i = 0, i_len = (n); i < i_len; ++i) {
    ll a;
    cin >> a;
    if (a != 0) zero = false;
    mp[a]++;
  }
  if (zero) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3 != 0 || mp.size() > 3 || mp.size() == 1) {
    cout << "No" << endl;
    return 0;
  }
  if (mp.size() == 3) {
    ll xs = 0;
    for (auto v : mp) xs ^= v.first;
    cout << (xs == 0 ? "Yes" : "No") << endl;
    return 0;
  }
  ll a, b;
  for (auto v : mp) {
    if (v.second > n / 2)
      a = v.first;
    else
      b = v.first;
  }
  cout << (b == 0 ? "Yes" : "No") << endl;
}
