#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
int a[100000];
map<int, int> m;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    m[a[i]]++;
  }
  if (n % 3 != 0 || m.size() != 3) return cout << "No", 0;
  int o = 0;
  pair<int, int> t[3];
  for (pair<int, int> p : m) t[o++] = p;
  if ((t[0].first ^ t[1].first) != t[2].first) return cout << "No", 0;
  sort(t, t + 3, [](pair<int, int> p, pair<int, int> q) {
    if (p.second > q.second) return true;
    return false;
  });
  int p[3] = {n / 3, n / 3, n / 3};
  sort(p, p + 3);
  if (p[0] != t[0].second || p[1] != t[1].second || p[2] != t[2].second)
    return cout << "No", 0;
  cout << "Yes";
}
