#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
const ll INF = 1e18;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  vector<int> a(N);
  set<int> s;
  bool answer = false;
  for (int i = 0; i < N; i++) {
    cin >> a.at(i);
    s.insert(a.at(i));
  }
  sort(a.begin(), a.end());
  if (s.size() == 3) {
    auto itr = s.begin();
    int x = *itr;
    int first_count = count(a.begin(), a.end(), *itr);
    itr++;
    int y = *itr;
    int second_count = count(a.begin(), a.end(), *itr);
    itr++;
    int z = *itr;
    int third_count = count(a.begin(), a.end(), *itr);
    if (first_count == second_count && second_count == third_count &&
        z == (x ^ y)) {
      answer = true;
    }
  }
  if (answer) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
