#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char* argv[]) {
  long long N;
  cin >> N;
  map<long long, int> a_count;
  for (int i = 0; i < N; i++) {
    long long tmp;
    cin >> tmp;
    if (a_count.find(tmp) != a_count.end()) {
      a_count[tmp] += 1;
    } else {
      a_count[tmp] = 1;
    }
  }
  if (a_count.size() > 3) {
    cout << "No" << endl;
    return 0;
  }
  bool exist = false;
  if (a_count.size() == 1) {
    auto a = *a_count.begin();
    exist = (a.first == 0 && a.second == N);
  } else if (a_count.size() == 2) {
    auto a0 = a_count.begin();
    auto a1 = next(a_count.begin(), 1);
    if (a0->first == 0) {
      auto tmp = a0;
      a0 = a1;
      a1 = tmp;
    }
    if (a1->first != 0) {
      cout << "No" << endl;
      return 0;
    }
    long long K = N / 3;
    if (N % 3 == 0) {
      exist = (a0->second == 2 * K && a1->second == K);
    } else if (N % 3 == 1) {
      exist = false;
    } else {
      exist = false;
    }
  } else if (a_count.size() == 3) {
    auto a0 = a_count.begin();
    auto a1 = next(a_count.begin(), 1);
    auto a2 = next(a_count.begin(), 2);
    long long K = N / 3;
    exist = (N % 3 == 0 && a0->second == K && a1->second == K &&
             a2->second == K && a0->first ^ a1->first ^ a2->first == 0);
  }
  cout << (exist ? "Yes" : "No") << endl;
  return 0;
}
