#include <bits/stdc++.h>
using namespace std;
inline void solve() {
  long long n;
  cin >> n;
  bool ok = true;
  if (n > 4)
    ok = false;
  else {
    set<long long> s;
    long long a[n];
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
      s.insert(a[i]);
    }
    sort(a, a + n);
    if ((long long)s.size() > 3 or (long long) s.size() < 3)
      ok = false;
    else {
      long long i = 0;
      vector<long long> h(3);
      for (auto &it : s) h[i++] = it;
      if (((h[0] ^ h[1]) != h[2]) or ((h[1] ^ h[2]) != h[0]) or
          ((h[2] ^ h[0]) != h[1]))
        ok = false;
    }
  }
  if (ok)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
signed main() {
  long long n = 1;
  while (n--) solve();
  return 0;
}
