#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x;
  map<int, int> cnt;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;
    cnt[x]++;
  }
  if (cnt.size() == 1 && cnt.count(0))
    cout << "Yes" << endl;
  else if (n % 3 == 0) {
    int ans = 1;
    vector<int> a;
    for (auto u : cnt)
      if (u.second % (n / 3))
        ans = 0;
      else
        for (int i = 0; i < u.second / (n / 3); i++) a.push_back(u.first);
    ans &= (a.size() == 3 && a[0] ^ a[1] == a[2]);
    cout << (ans ? "Yes" : "No") << endl;
  } else
    cout << "No" << endl;
}
