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