#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  cin >> N;
  vector<long long> a(N);
  for (int i = 0; i < N; ++i) cin >> a[i];
  map<int, int> c;
  for (int i = 0; i < N; ++i) {
    c[a[i]] += 1;
  }
  if (c.size() >= 4) {
    cout << "No" << endl;
    return 0;
  }
  if (c.size() == 1) {
    if (c[0] >= 1)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    return 0;
  } else if (c.size() == 2) {
    if (c[0] == 0) {
      cout << "No" << endl;
      return 0;
    }
    auto itr = c.begin();
    if ((++itr)->second == 2 * c[0])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    return 0;
  }
  vector<int> tmp(3);
  int ind = 0;
  for (auto jtr = c.begin(); jtr != c.end(); ++jtr) {
    tmp[ind++] = jtr->first;
  }
  auto itr = c.begin();
  int cnt = itr->second;
  if (tmp[0] ^ tmp[1] != tmp[2]) {
    cout << "No" << endl;
  } else {
    for (auto jtr = c.begin(); jtr != c.end(); ++jtr) {
      if (cnt != jtr->second) {
        cout << "No" << endl;
        return 0;
      }
      cnt = jtr->second;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
