#include <bits/stdc++.h>
const int MGN = 8;
const int ARY_SZ_MAX = 10000000;
using namespace std;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvvb = vector<vvb>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vd = vector<double>;
using vs = vector<string>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using psi = pair<string, int>;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  vi A(N);
  for (int i = int(0); i < int(N); ++i) cin >> A[i];
  map<int, int> mp;
  for (int i = int(0); i < int(N); ++i) mp[A[i]]++;
  bool ok = false;
  if (mp.size() == 1) {
    if (mp[0] == N) ok = true;
  } else if (mp.size() == 2) {
    ok = true;
    for (auto p : mp) {
      if (p.first == 0 && p.second == (N + 1) / 3)
        continue;
      else if (p.second * 3 >= (N + 1) / 3 * 2)
        continue;
      ok = false;
      break;
    }
  } else if (mp.size() == 3) {
    ok = true;
    vi num;
    for (auto p : mp) {
      num.push_back(p.first);
      if (p.second * 3 == N) continue;
      ok = false;
      break;
    }
    if (ok && (num[0] ^ num[1] ^ num[2]) != 0) ok = false;
  }
  string ans = ok ? "Yes" : "No";
  cout << ans << endl;
  return 0;
}
