#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  ll N;
  cin >> N;
  map<ll, ll> mp;
  for (int i = 0; i < (N); i++) {
    ll a;
    cin >> a;
    mp[a]++;
  }
  bool flag = false;
  if (N % 3 == 0) {
    if (mp.size() == 3) {
      ll xo = 0;
      vector<ll> c;
      for (auto e : mp) {
        xo = xo ^ e.first;
        c.push_back(e.second);
      }
      if (xo == 0 && c[0] == c[1] == c[2]) flag = true;
    }
    if (mp.size() == 2) {
      vector<ll> c;
      for (auto e : mp) c.push_back(e.second);
      sort((c).begin(), (c).end());
      if (mp[0] == N / 3 && c[0] * 2 == c[1]) flag = true;
    }
  }
  if (mp[0] == N) flag = true;
  cout << (flag ? "Yes" : "No") << endl;
}
