#include <bits/stdc++.h>
using namespace std;
long long n;
long long a[100001];
vector<long long> vs;
map<long long, long long> cnt;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n;
  for (long long i = (long long)(0); i < (long long)(n); i++) {
    cin >> a[i];
    cnt[a[i]]++;
    vs.push_back(a[i]);
  }
  sort((vs).begin(), (vs).end());
  vs.erase(unique((vs).begin(), (vs).end()), vs.end());
  if (vs.size() != 3 || ((vs[0] ^ vs[1] ^ vs[2]) != 0)) {
    cout << "No" << endl;
    return 0;
  }
  if (n % 2 == 0) {
    if (cnt[vs[0]] == cnt[vs[1]] && cnt[vs[1]] == cnt[vs[2]])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else {
    long long mx = max({cnt[vs[0]], cnt[vs[1]], cnt[vs[2]]});
    long long rcnt = 0;
    for (long long j = (long long)(0); j < (long long)(3); j++)
      if (cnt[vs[j]] == mx) rcnt++;
    if (n % 3 == rcnt % 3)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
