#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, i, j;
  cin >> N;
  vector<int> a(N);
  for (i = 0; i < N; i++) {
    cin >> a.at(i);
  }
  sort(a.begin(), a.end());
  int target = a.at(0);
  int ind = 0;
  int count = 0;
  vector<int> item;
  vector<int> item_num;
  while (ind < N) {
    for (i = ind; i < N; i++) {
      if (target == a.at(i)) {
        count++;
        if (i == N - 1) {
          item.push_back(target);
          item_num.push_back(count);
          ind = N;
        }
      } else {
        item.push_back(target);
        item_num.push_back(count);
        target = a.at(i);
        ind = i;
        count = 0;
        break;
      }
    }
  }
  string ret = "No";
  if (item.size() == 1) {
    if (item.at(0) == 0) ret = "Yes";
  } else if (N % 3 == 0) {
    if (item.size() == 2) {
      if ((item.at(0) == 0 && item_num.at(0) == N / 3) ||
          (item.at(1) == 0 && item_num.at(1) == N / 3))
        ret = "Yes";
    } else if (item.size() == 3) {
      if (item.at(0) ^ item.at(1) == item.at(2)) {
        if (item_num.at(0) == N / 3 && item_num.at(1) == N / 3 &&
            item_num.at(2) == N / 3)
          ret = "Yes";
      }
    }
  }
  cout << ret << endl;
}
