#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  map<long long, long long> freq;
  long long tmp;
  for (long long i = 0; i < (n); i++) cin >> tmp, freq[tmp]++;
  vector<pair<long long, long long>> a;
  for (auto &p : freq) a.push_back(p);
  if (n % 3 != 0) return cout << "No", 0;
  if (a.size() > 3) return cout << "No", 0;
  if (a.size() == 3) {
    if (a[0].second == a[1].second && a[1].second == a[2].second &&
        ((a[0].first ^ a[1].first) == a[2].first))
      return cout << "Yes", 0;
    else
      return cout << "No", 0;
  }
  if (a.size() == 2) {
    sort(a.begin(), a.end(),
         [](pair<long long, long long> &x, pair<long long, long long> &y)
             -> bool { return x.second < y.second; });
    if (a[0].first == 0 && ((a[0].second * 2) == a[1].second))
      return cout << "Yes", 0;
    else
      return cout << "No", 0;
  }
  if (a.size() == 1) {
    if (a[0].first == 0)
      return cout << "Yes", 0;
    else
      return cout << "No", 0;
  }
  assert(false);
  return 0;
}
