#include <bits/stdc++.h>
using namespace std;
int solve() {
  long long n;
  cin >> n;
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    int p;
    cin >> p;
    mp[p]++;
  }
  map<int, int>::iterator it = mp.begin();
  map<int, int>::iterator it1 = mp.begin();
  it1++;
  map<int, int>::iterator it2 = mp.begin();
  it2++;
  it2++;
  if (mp.size() == 1 && it->first == 0) {
    cout << "Yes" << endl;
    return 0;
  } else if ((mp.size() == 2) && (it->first == 0) &&
             (it->second == ((it1->second) - 1))) {
    cout << "Yes" << endl;
    return 0;
  } else if ((mp.size() == 3) && (((it->first) ^ (it1->first)) == it2->first) &&
             (it->second == it1->second && it1->second == it2->second)) {
    cout << "Yes" << endl;
    return 0;
  } 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();
  }
}
