#include <bits/stdc++.h>
using namespace std;
void inputArray(int* p, int a) {
  for (int i = (0); i < (a); i++) {
    cin >> p[i];
  }
};
int main(int argc, const char* argv[]) {
  long long N;
  long long i, j, k;
  cin >> N;
  map<long long, long long> freq;
  long long num;
  bool include_zero = false;
  for (i = 0; i < N; i++) {
    cin >> num;
    if (num == 0) include_zero = true;
    freq[num]++;
  }
  if (freq.size() == 1) {
    if (freq[0] == N) {
      cout << "Yes" << endl;
      return 0;
    }
    cout << "No" << endl;
    return 0;
  }
  if (include_zero) {
    if (freq.size() != 2) {
      cout << "No" << endl;
      return 0;
    }
    long long k;
    for (const auto& x : freq) {
      if (x.first != 0) k = x.first;
    }
    if (freq[0] == N / 3 && freq[k] == 2 * N / 3) {
      cout << "Yes" << endl;
      return 0;
    }
  } else {
    if (freq.size() != 3) {
      cout << "No" << endl;
      return 0;
    }
    vector<long long> val(3, 0);
    i = 0;
    for (const auto& x : freq) {
      val[i] = x.first;
      i++;
    }
    if (freq[val[0]] == freq[val[1]] && freq[val[1]] == freq[val[2]] &&
        freq[val[0]] == N / 3) {
      if (val[0] ^ val[1] ^ val[2] == 0) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
  return 0;
}
