#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;
    if (mp.find(a) == mp.end()) {
      mp.emplace(a, 1);
    } else {
      mp[a]++;
    }
  }
  if (mp.size() == 1) {
    if (mp.begin()->first == 0) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  if (mp.size() == 2) {
    auto itr = mp.begin();
    if (itr->second * 2 == next(itr)->second) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  if (mp.size() == 3) {
    auto itr = mp.begin();
    if (itr->second == next(itr)->second &&
        next(itr)->second == next(itr, 2)->second) {
      if (itr->first ^ next(itr)->first ^ next(itr, 2)->first == 0) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
  return 0;
}
