#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll N;
  cin >> N;
  ll a;
  map<ll, int> c;
  for (int i = 0; i < N; i++) {
    cin >> a;
    c[a]++;
  }
  vector<ll> k, n;
  for (auto p : c) {
    k.push_back(p.first);
    n.push_back(p.second);
  }
  if (k.size() != 3) {
    cout << "No"
         << "\n";
    return 0;
  }
  if (k[0] ^ k[1] != k[2] || n[0] != n[1] || n[1] != n[2] || n[2] != n[0]) {
    cout << "No"
         << "\n";
    return 0;
  }
  cout << "Yes"
       << "\n";
  return 0;
}
