#include <bits/stdc++.h>
int main() {
  int N;
  std::cin >> N;
  std::vector<int> a(N);
  for (auto& v : a) std::cin >> v;
  std::sort(begin(a), end(a));
  bool ans = false;
  std::map<int, int> m;
  for (auto& v : a) ++m[v];
  auto x = m.begin();
  auto y = std::next(x);
  auto z = std::next(y);
  ans = (m.size() == 3 && (x->first ^ y->first) == z->first &&
         (N > 3 ? (x->second == y->second == z->second - 1 ||
                   y->second == z->second == x->second - 1 ||
                   z->second == x->second == y->second - 1)
                : z->second == x->second == y->second));
  std::cout << (ans ? "Yes" : "No") << std::endl;
}
