#include <bits/stdc++.h>
using namespace std;
long long inf = -1;
long long mod = pow(10, 9) + 7;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  vector<pair<int, int> > cnt;
  int c = 1;
  for (int i = 1; i < n; i++) {
    if (a[i - 1] == a[i]) {
      c++;
    } else {
      cnt.push_back(pair<int, int>(a[i - 1], c));
      c = 1;
    }
    if (i == n - 1) {
      cnt.push_back(pair<int, int>(a[i], c));
    }
  }
  if (cnt.size() == 3 && (cnt[0].second == cnt[1].second) == cnt[2].second) {
    if ((cnt[0].first ^ cnt[1].first) == cnt[2].first) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}
