#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<unsigned int> a(n);
  for (int i = 0; i < (int)(n); i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  vector<unsigned int> b = a;
  a.erase(unique(a.begin(), a.end()), a.end());
  if (a.size() > 3) {
    cout << "No";
    return 0;
  }
  bool flag = false;
  if (a.size() == 1) {
    if (b[n - 1] == 0) flag = true;
  } else if (a.size() == 2) {
    if (n % 3 != 0) {
      cout << "No";
      return 0;
    }
    if (a[0] == 0) {
      if (b[n / 3 - 1] == 0 && b[n / 3] == a[1]) flag = true;
    }
  } else if (a.size() == 3) {
    if (n % 3 != 0) {
      cout << "No";
      return 0;
    }
    if (a[0] ^ a[1] ^ a[2] == 0) {
      if (b[n / 3 - 1] == a[0] && b[n / 3] == a[1] &&
          b[2 * n / 3 - 1] == a[1] && b[2 * n / 3] == a[2])
        flag = true;
    }
  }
  if (flag)
    cout << "Yes";
  else
    cout << "No";
}
