#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = double;
const ll mod = 1000000007;
const ll INF = 1000000099;
signed main() {
  ll n;
  cin >> n;
  bool ans = true;
  vector<ll> a(n);
  for (ll i = 0; i < (ll)(n); i++) {
    cin >> a[i];
    if (a[i] != 0) ans = false;
  }
  sort((a).begin(), (a).end());
  if (n % 3 != 0) {
    if (ans)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else {
    if (a[0] == a[-1 + n / 3] && a[n / 3] == a[2 * n / 3 - 1] &&
        a[2 * n / 3] == a[n - 1] && a[0] ^ a[n - 1] == a[n / 3] &&
        a[0] ^ a[n / 3] == a[n - 1] && a[n - 1] ^ a[n / 3] == a[0]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}
