#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, x[3], count[3], j = 0;
  cin >> n;
  vector<int> a(n);
  for (i = 0; i < n; i++) {
    cin >> a.at(i);
  }
  sort(a.begin(), a.end());
  string ans = "Yes";
  x[0] = a.at(0);
  for (i = 1; i < n; i++) {
    count[j]++;
    if (a.at(i) != a.at(i - 1)) {
      if (j >= 2) {
        ans = "No";
        break;
      }
      x[j + 1] = a.at(i);
      j++;
    }
  }
  if (j == 2 && count[0] == count[1] && count[1] == count[2] &&
      a.at(0) ^ a.at(1) == a.at(2)) {
    cout << "Yes" << endl;
  } else {
    cout << ans << endl;
  }
}
