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