#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long N;
  cin >> N;
  vector<long long> a(N);
  for (long long i = 0; i < (long long)(N); i++) cin >> a[i];
  map<long long, long long> m;
  for (long long i = 0; i < (long long)(N); i++) m[a[i]]++;
  if (m.size() == 3) {
    auto b = m.begin();
    auto c = next(b, 1);
    auto d = next(b, 2);
    long long bn = (*b).second;
    long long cn = (*c).second;
    long long dn = (*d).second;
    long long bb = (*b).first;
    long long cc = (*c).first;
    long long dd = (*d).first;
    if (bn == cn && cn == dn && (bb ^ cc) == dd) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}
