#include <bits/stdc++.h>
using namespace std;
inline void YesNo(bool b) { cout << (b ? "Yes" : "No") << endl; }
inline void YESNO(bool b) { cout << (b ? "YES" : "NO") << endl; }
inline void Yay(bool b) { cout << (b ? "Yay!" : ":(") << endl; }
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << setprecision(15);
  int N;
  cin >> N;
  map<long long, int> mp;
  for (int i = 0, i_max = (N); i < i_max; ++i) {
    long long x;
    cin >> x;
    ++mp[x];
  }
  bool issat = false;
  vector<pair<long long, int> > v;
  for (auto itr = mp.begin(); itr != mp.end(); ++itr)
    v.push_back(pair<int, long long>(itr->first, itr->second));
  if (mp.count(0)) {
    if (v.size() == 1)
      issat = true;
    else if (v.size() == 2) {
      if (v[1].first == 0ll) swap(v[0], v[1]);
      if (v[0].second == 2 * v[1].second) issat = true;
    }
  } else if (v.size() == 3) {
    if (v[0].second == v[1].second && v[1].second == v[2].second) issat = true;
    if (v[0].first != (v[1].first ^ v[2].first)) issat = false;
  }
  YesNo(issat);
  return 0;
}
