#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  map<int, int> mp;
  for (int i = 0; i <= N - 1; ++i) {
    cin >> a[i];
    mp[a[i]]++;
  }
  bool ok = false;
  auto is_zero = [](int n) -> bool { return n == 0; };
  int zeros = count_if(a.begin(), a.end(), is_zero);
  if (all_of(a.begin(), a.end(), is_zero))
    ok = true;
  else if (a.size() == zeros * 3 && mp.size() == 1)
    ok = true;
  else {
    if (mp.size() == 3) {
      auto it1 = mp.begin();
      auto it2 = next(it1);
      auto it3 = next(it2);
      if ((it1->first ^ it2->first ^ it3->first) == 0)
        if (it1->second == it2->second && it2->second == it3->second) ok = true;
    }
  }
  if (ok)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
