#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll n;
  cin >> n;
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  vector<ll> v(n);
  for (int i = 0; i < (int)(n); i++) cin >> v[i];
  sort(v.begin(), v.end());
  int x = n / 3;
  if (v[0] == v[x - 1] && v[x] == v[2 * x - 1] && v[2 * x] == v[n - 1] &&
      v[0] != v[x] && v[x] != v[2 * x]) {
    int a = v[0];
    int b = v[x];
    int c = v[2 * x];
    int d = a ^ b;
    if (d == c)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else
    cout << "No" << endl;
}
