#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;
  ans &= a.size() == 3;
  int cnt = -1;
  int values[3];
  int index = 0;
  for (auto v_cnt : a) {
    values[index] = v_cnt.first;
    index++;
    if (cnt == -1)
      cnt = v_cnt.second;
    else
      ans &= v_cnt.second == cnt;
  }
  ans &= (values[0] ^ values[1]) == values[2];
  if (ans)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
