#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < N; i++) {
    cin >> a.at(i);
  }
  bool hantei = true;
  bool case1 = true;
  for (int i = 0; i < N; i++) {
    if (a.at(i) == 0) {
    } else {
      case1 = false;
    }
  }
  bool case23 = true;
  if (N % 3 != 0) {
    case23 = false;
  }
  sort(a.begin(), a.end());
  if (a.at(0) == 0) {
    if (a.at((2 * N / 3) - 1) != 0 || a.at(2 * N / 3) != a.at(N - 1)) {
      case23 = false;
    }
  } else {
    if ((a.at(0) != a.at((N / 3) - 1)) || (a.at((N / 3) - 1) == a.at(N / 3))) {
      case23 = false;
    } else if ((a.at(3 / N) != a.at((2 * N / 3) - 1)) ||
               (a.at((2 * N / 3) - 1) == a.at(2 * N / 3))) {
      case23 = false;
    } else if (a.at(2 * N / 3) == a.at(N - 1)) {
      case23 = false;
    }
    if (a.at(N - 1) != a.at((2 * N / 3) - 1) ^ a.at((N / 3) - 1)) {
      case23 = false;
    }
  }
  if (case1 || case23) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
