#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using ull = uint64_t;
constexpr ll INF = 1000000000;
namespace utils {
template <class T, class Compare>
using p_queue = priority_queue<T, vector<T>, Compare>;
template <class T>
using min_queue = p_queue<T, greater<T>>;
template <class T>
using max_queue = p_queue<T, less<T>>;
template <class T>
bool min_update(T& X, const T& A) {
  if (X > A) {
    X = A;
    return true;
  }
  return false;
}
template <class T>
bool max_update(T& X, const T& A) {
  if (X < A) {
    X = A;
    return true;
  }
  return false;
}
using V_Set = unordered_set<int>;
using E_Set = unordered_map<int, V_Set>;
}  // namespace utils
using namespace utils;
void sub_main(istream& is) {
  ll N;
  is >> N;
  if (!is) return;
  map<int, int> a;
  for (int i = 0; i < N; ++i) {
    int t;
    is >> t;
    a[t]++;
  }
  bool yes = a.size() == 3;
  if (yes) {
    yes = false;
    auto p = a.begin();
    auto x = *p;
    ++p;
    auto y = *p;
    ++p;
    auto z = *p;
    if ((x.first ^ y.first) == z.first) {
      if (x.second == y.second and x.second == z.second) {
        yes = true;
      }
    }
  }
  yes |= a.size() == 1 and a.begin()->first == 0;
  cout << (yes ? "Yes" : "No") << endl;
}
int main(int argc, char* argv[]) {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << setprecision(16) << scientific;
  sub_main(cin);
  return 0;
}
