#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[100010];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  int tmp = n / 3;
  for (int i = 1; i < tmp; i++) {
    if (a[i - 1] != a[i] || a[tmp + i - 1] != a[tmp + i] ||
        a[tmp * 2 + i - 1] != a[tmp * 2 + i]) {
      cout << "No" << endl;
      return 0;
    }
  }
  if ((a[0] ^ a[tmp]) == a[2 * tmp]) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
