#include <bits/stdc++.h>
using namespace std;
bool AtCoder() {
  int N;
  cin >> N;
  set<int> s;
  multiset<int> ms;
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    s.insert(a);
    ms.insert(a);
  }
  if (s.size() == 1 and s.count(0) != 0) return true;
  if (s.size() != 3) return false;
  for (int a : s) {
    if (ms.count(a) != N / 3) return false;
  }
  vector<int> vec;
  for (int a : s) {
    vec.push_back(a);
  }
  if (vec[0] ^ vec[1] == vec[2])
    return true;
  else
    return false;
}
int main() {
  if (AtCoder())
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
