#include <bits/stdc++.h>
using namespace std;
bool solve(const vector<int>& a) {
  int n = a.size();
  map<int, int> cnt;
  for (int i = 0; i < n; ++i) ++cnt[a[i]];
  if (cnt.size() == 1) return a[0] == 0;
  if (cnt.size() == 3) {
    vector<pair<int, int> > v(cnt.begin(), cnt.end());
    return v[0].second == v[1].second && v[1].second == v[2].second &&
           (v[0].first ^ v[1].first) == v[2].first;
  }
  return false;
}
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  if (solve(a))
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
