#include <bits/stdc++.h>
using namespace std;
signed main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  map<int, int> mp;
  for (int i = 0; i < n; i++) mp[a[i]]++;
  if (mp.size() != 3 || n % 3) {
    cout << "No" << endl;
    return 0;
  }
  vector<int> use;
  for (auto x : mp) {
    use.push_back(x.first);
  }
  if (use[0] ^ use[1] == use[2] && use[0] ^ use[2] == use[1] &&
      use[1] ^ use[2] == use[0]) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
