#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<long long int, int> cnt;
  for (int i = 0; i < n; i++) {
    long long int a;
    cin >> a;
    cnt[a]++;
  }
  auto itr = cnt.begin();
  if (cnt.size() > 3 || cnt.size() == 0 || cnt.size() == 2) {
    cout << "No" << endl;
    return 0;
  } else if (cnt.size() == 1) {
    if (itr->first == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    return 0;
  } else {
    auto itr1 = cnt.begin();
    itr1++;
    auto itr2 = cnt.begin();
    itr2++;
    itr2++;
    if (itr->second == itr1->second && itr1->second == itr2->second) {
      if (itr->first ^ itr1->first == itr2->first) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
