#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();
  string ans;
  if (cnt.size() == 1)
    ans = (itr->first == 0) ? "Yes" : "No";
  else if (cnt.size() == 3) {
    auto itr1 = cnt.begin();
    itr1++;
    auto itr2 = cnt.begin();
    itr2++;
    itr2++;
    if (itr->second == itr1->second && itr1->second == itr2->second) {
      ans = (itr->first ^ itr1->first ^ itr2->first == 0) ? "Yes" : "No";
    } else
      ans = "No";
  } else
    ans = "No";
  cout << ans << endl;
  return 0;
}
