#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll inf = numeric_limits<ll>::max() / 3;
const ll mod = 1e9 + 7;
int main(void) {
  int n;
  map<ll, ll> a;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    ll tmp;
    cin >> tmp;
    a[tmp]++;
  }
  vector<pair<ll, ll>> calc;
  for (auto p : a) {
    calc.push_back(p);
  }
  if (a[0] == n) {
    puts("Yes");
    return 0;
  }
  if (n % 3 != 0) {
    puts("No");
    return 0;
  }
  if (calc.size() == 3 && calc[0].first ^ calc[1].first == calc[2].first &&
      calc[0].second == n / 3 && calc[1].second == n / 3 &&
      calc[2].second == n / 3) {
    cout << "Yes" << endl;
  } else if (calc.size() == 2 && calc[0].first == 0 &&
             calc[0].second == n / 3 && calc[1].second == (n * 2) / 3) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
