#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int num, i, ok = true;
  cin >> num;
  vector<int> d(num), a;
  map<int, int> mp;
  for (i = 0; i < num; i++) scanf("%d", &d[i]);
  sort(d.begin(), d.end());
  a.push_back(d[0]);
  mp[d[0]]++;
  for (i = 1; i < num; i++) {
    if (d[i - 1] != d[i]) a.push_back(d[i]);
    mp[d[i]]++;
  }
  for (i = 0; a.size() <= 3 && i < a.size() - 1; i++) {
    if (mp[a[i]] != mp[a[i + 1]]) ok = false;
  }
  switch (a.size()) {
    case 1:
      if ((a[0] ^ a[0]) != a[0]) ok = false;
      break;
    case 2:
      if (a[0] != 0 && a[1] != 0) ok = false;
      if ((a[0] ^ a[1]) != a[0] && (a[0] ^ a[1]) != a[1]) ok = false;
      break;
    case 3:
      if ((a[0] ^ a[1]) != a[2]) ok = false;
      break;
    default:
      ok = false;
      break;
  }
  if (ok)
    cout << "Yes\n";
  else
    cout << "No\n";
  return 0;
}
