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