#include <bits/stdc++.h>
using namespace std;
int solve() {
  long long n;
  cin >> n;
  map<int, int> mp;
  set<int> a;
  for (int i = 0; i < n; i++) {
    int p;
    cin >> p;
    mp[p]++;
    a.insert(p);
  }
  map<int, int>::iterator mp1 = mp.begin();
  map<int, int>::iterator mp2 = mp.begin();
  mp2++;
  map<int, int>::iterator mp3 = mp.begin();
  mp3++;
  mp3++;
  if ((mp1->second - mp2->second) >= 2 || ((mp1->second - mp3->second) >= 2) ||
      (mp2->second - mp3->second) >= 2) {
    cout << "No" << endl;
    return 0;
  }
  set<int>::iterator it1 = a.begin();
  set<int>::iterator it2 = a.begin();
  it2++;
  set<int>::iterator it3 = a.begin();
  it3++;
  it3++;
  if (a.size() == 3 && (((*it1) ^ (*it2)) == (*it3)))
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  t = 1;
  while (t--) {
    solve();
  }
}
