#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
bool chkmin(T1 &x, T2 y) {
  return y < x ? (x = y, true) : false;
}
template <typename T1, typename T2>
bool chkmax(T1 &x, T2 y) {
  return y > x ? (x = y, true) : false;
}
void yes() {
  cout << "Yes\n";
  exit(0);
}
void no() {
  cout << "No\n";
  exit(0);
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  map<int, int> cnt;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    cnt[x]++;
  }
  if (cnt.size() >= 4) no();
  if (cnt.size() == 1) yes();
  if (n % 3 != 0) no();
  vector<pair<int, int> > t;
  for (auto el : cnt) t.push_back(el);
  sort(t.begin(), t.end());
  if (t.size() == 2 && t[0] == make_pair(0, n / 3) ||
      t.size() == 3 && (t[0].first ^ t[1].first ^ t[2].first) == 0 &&
          t[0].second == n / 3 && t[1].second == n / 3) {
    yes();
  } else {
    no();
  }
  return 0;
}
