#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 (m.size() != 3) return cout << "No", 0;
  int t[3];
  int o = 0;
  for (pair<int, int> p : m) t[o++] = p.first;
  if ((t[0] ^ t[1]) != t[2]) return cout << "No", 0;
  int p[3] = {n / 3 + ((n % 3) > 0), n / 3 + ((n % 3) > 1), n / 3};
  sort(p, p + 3);
  int q[3] = {0, 0, 0};
  int k = 0;
  for (pair<int, int> p : m) q[k++] = p.second;
  sort(q, q + 3);
  if (p[0] != q[0] || p[1] != q[1] || p[2] != q[2]) return cout << "No", 0;
  cout << "Yes";
}
