#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  map<int64_t, int> m;
  for (int i = 0; i < N; ++i) {
    int64_t k;
    cin >> k;
    m[k] += 1;
  }
  bool result = false;
  if (m.count(0)) {
    if (m.at(0) == N) {
      result = true;
    } else {
      auto it = m.begin();
      int count = it->second;
      ++it;
      count += it->second;
      if (count == N) {
        result = true;
      }
    }
  } else if (m.size() == 3) {
    auto it = m.begin();
    int64_t x = it->first;
    int count = it->second;
    ++it;
    x ^= it->first;
    count += it->second;
    ++it;
    x ^= it->first;
    count += it->second;
    if (x == 0 && count == N) {
      result = true;
    }
  }
  cout << (result ? "Yes" : "No") << endl;
}
