#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<long long> a(n);
  map<long long, long long> cnt;
  set<long long> s;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    cnt[a[i]]++;
    s.insert(a[i]);
  }
  string ret = "Yes";
  if (s.size() > 3 || n % 3 != 0) {
    ret = "No";
  } else if (s.size() == 3) {
    auto itr = s.begin();
    long long p = *itr, q = *(++itr), r = *(++itr);
    if (cnt[p] != n / 3) ret = "No";
    if (cnt[q] != n / 3) ret = "No";
    if (cnt[r] != n / 3) ret = "No";
    if ((p ^ r) != q) ret = "No";
    if ((q ^ p) != r) ret = "No";
    if ((r ^ q) != p) ret = "No";
  } else if (s.size() == 1) {
    long long p = *(s.begin());
    if ((p ^ p) != p) ret = "No";
  } else if (s.size() == 2) {
    auto itr = s.begin();
    long long p = *itr, q = *(++itr);
    if (cnt[p] > cnt[q]) swap(p, q);
    if (cnt[p] != n / 3) ret = "No";
    if (cnt[q] != n / 3 * 2) ret = "No";
    if ((p ^ q) != q) ret = "No";
    if ((q ^ q) != p) ret = "No";
  }
  cout << ret << endl;
}
