#include <bits/stdc++.h>
using namespace std;
using Pll = pair<long long, long long>;
const long long INF = 1LL << 60;
const long long MOD = 1000000007;
int main() {
  long long N;
  cin >> N;
  vector<long long> A(N);
  map<long long, long long> mp;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    mp[A[i]]++;
  }
  if (mp.size() == 3) {
    long long tmp;
    long long cxor;
    for (auto it = mp.begin(); it != mp.end(); ++it) {
      if (it == mp.begin()) {
        tmp = it->second;
        cxor = it->first;
      } else {
        if (it->second != tmp) {
          cout << "No" << endl;
          return 0;
        } else {
          cxor = (cxor ^ it->first);
        }
      }
    }
    if (cxor != 0) {
      cout << "No" << endl;
      return 0;
    } else {
      cout << "Yes" << endl;
      return 0;
    }
  } else if (mp.size() == 2) {
    auto it = mp.begin();
    if (it->first != 0 && next(it)->first == 0 &&
        it->second == (next(it))->second + 1) {
      cout << "Yes" << endl;
      return 0;
    } else if (it->first == 0 && next(it)->first != 0 &&
               it->second == (next(it))->second - 1) {
      cout << "Yes" << endl;
      return 0;
    } else {
      cout << "No" << endl;
      return 0;
    }
  } else {
    cout << "No" << endl;
    return 0;
  }
  return 0;
}
