#include <bits/stdc++.h>
using namespace std;
const int INF = 1000 * 1000 * 1000 + 7;
const long long LINF = 1LL * INF * INF;
const int MAX = 1e6 + 7;
const double PI = acos(-1.);
const double EPS = 1e-7;
const int MAXN = 100005;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
set<int> x[100005];
int cnt[100005];
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (n); ++i) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  if (a[0] == a[n / 3 - 1] && a[n / 3] == a[2 * n / 3 - 1] &&
      a[2 * n / 3] == a[n - 1] && (a[0] ^ a[n / 3] ^ a[2 * n / 3] == 0)) {
    cout << "Yes\n";
  } else {
    cout << "No\n";
  }
  return 0;
}
