#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n;
  cin >> n;
  map<int, int> a;
  for (int i = (0); i < (n); i++) {
    int aa;
    cin >> aa;
    a[aa]++;
  }
  bool ans = true;
  vector<int> values;
  vector<int> cnts;
  for (auto v_cnt : a) {
    values.push_back(v_cnt.first);
    cnts.push_back(v_cnt.second);
  }
  if (a.size() == 3) {
    int cnt = cnts[0];
    for (int i = (0); i < (3); i++) ans &= cnt == cnts[i];
    ans &= (values[0] ^ values[1]) == values[2];
  } else if (a.size() == 2) {
    ans &= 2 * min(cnts[0], cnts[1]) == max(cnts[0], cnts[1]);
    ans &= (values[0] ^ values[1]) == values[0];
  } else if (a.size() == 1) {
    ans &= values[0] == 0;
  } else
    ans = false;
  if (ans)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
