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