#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  map<int, int> mp;
  for (auto &x : a) {
    cin >> x;
    mp[x]++;
  }
  sort(a.begin(), a.end());
  unique(a.begin(), a.end());
  if (mp.size() == 3) {
    if ((mp[a[0]] == mp[a[1]]) && (mp[a[1]] == mp[a[2]]) &&
        (a[0] ^ a[1] == a[2])) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else if (mp.size() == 2) {
    if (mp[a[1]] == 2 * mp[0]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else if (mp.size() == 1) {
    if (mp[0]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    cout << "No" << endl;
  }
  return 0;
}
