#include <bits/stdc++.h>
using namespace std;
long long n;
vector<long long> a, s;
map<long long, long long> mp;
bool solve();
int main() {
  cin >> n;
  a.resize(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  if (solve())
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
bool solve() {
  for (int i = 0; i < n; ++i) ++mp[a[i]];
  sort(a.begin(), a.end());
  a.erase(unique(a.begin(), a.end()), a.end());
  if (mp.size() == 1 && a[0] == 0) return 1;
  if (mp.size() != 3) return 0;
  if (a[0] != (a[1] ^ a[2])) return 0;
  if (n % 3 != 0) return 0;
  return 1;
}
