#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n;
  cin >> n;
  map<long long, long long> mp;
  for (long long i = 0; i < n; i++) {
    long long a;
    cin >> a;
    mp[a]++;
  }
  if (mp[0] == n) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  vector<long long> cnt;
  for (auto itr : mp) {
    for (long long i = 0; i < itr.second / (n / 3); i++) {
      cnt.push_back(itr.first);
    }
  }
  if (cnt.size() == 3 && cnt[0] ^ cnt[1] ^ cnt[1] == 0) {
    cout << "Yes" << endl;
    return 0;
  } else {
    cout << "No" << endl;
    return 0;
  }
}
