#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;
int main() {
  int N;
  cin >> N;
  map<int, int> m;
  for (int i{}; i < N; ++i) {
    int a;
    cin >> a;
    ++m[a];
  }
  vector<P> v;
  for (const auto& p : m) v.push_back(p);
  sort(v.begin(), v.end(), [](P l, P r) { return l.second < r.second; });
  int ans{};
  switch (v.size()) {
    case 1:
      if (v[0].first == 0) ans = true;
      break;
    case 2:
      if (v[0].second * 2 == v[1].second &&
          v[0].first ^ v[1].first == v[0].first &&
          v[0].first ^ v[0].first == v[1].first)
        ans = true;
      break;
    case 3:
      if (v[0].second == v[1].second && v[1].second == v[2].second &&
          v[0].first ^ v[1].first == v[2].first &&
          v[1].first ^ v[2].first == v[0].first &&
          v[2].first ^ v[0].first == v[1].first)
        ans = true;
      break;
    default:
      break;
  }
  cout << (ans ? "Yes" : "No") << endl;
  return 0;
}
