#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using pl = pair<ll, ll>;
using vpl = vector<pl>;
using vvpl = vector<vpl>;
const ll MOD = 1000000007;
const ll MOD9 = 998244353;
const int inf = 1e9 + 10;
const ll INF = 4e18;
const ll dy[8] = {1, 0, -1, 0, 1, 1, -1, -1};
const ll dx[8] = {0, -1, 0, 1, 1, -1, 1, -1};
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  ll n;
  cin >> n;
  map<ll, ll> mp;
  for (ll i = 0; i < n; i++) {
    ll a;
    cin >> a;
    mp[a]++;
  }
  if (mp.size() > 3) cout << "No" << endl;
  if (mp.size() == 3) {
    ll pre = -1;
    bool flag = true;
    ll x = 0;
    for (auto p : mp) {
      x ^= p.first;
      if (pre = -1)
        pre = p.second;
      else {
        if (pre != p.second) flag = false;
      }
    }
    cout << ((flag && x == 0) ? "Yes" : "No") << endl;
  }
  if (mp.size() == 2) {
    if (n % 3)
      cout << "No" << endl;
    else {
      ll t = n / 3;
      if (mp[0] != t)
        cout << "No" << endl;
      else {
        mp.erase(0);
        bool flag = true;
        for (auto p : mp) {
          if (p.second != 2 * t) flag = false;
        }
        cout << (flag ? "Yes" : "No") << endl;
      }
    }
  }
  if (mp.size() == 1) {
    cout << (mp[0] ? "Yes" : "No") << endl;
  }
}
