#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
bool contain(set<char> &s, char a) { return s.find(a) != s.end(); }
const int mod = 1000000007;
typedef priority_queue<long long, vector<long long>, greater<long long> >
    PQ_ASK;
int main() {
  int n;
  cin >> n;
  vector<unsigned long long> caps(n);
  for (int i = 0; i < (n); ++i) cin >> caps[i];
  map<unsigned long long, int> m;
  for (unsigned long long c : caps) m[c]++;
  if (m.find(0) != m.end() && m[0] == n) {
    cout << "Yes" << endl;
    return 0;
    ;
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
    ;
  }
  vector<unsigned long long> numbers, counts;
  for (auto e : m) {
    numbers.push_back(e.first);
    counts.push_back(e.second);
  }
  if (numbers.size() == 2) {
    if (numbers[0] == 0 && counts[1] == 2 * n / 3) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
    return 0;
    ;
  }
  if (numbers.size() == 3) {
    if ((numbers[0] ^ numbers[1] ^ numbers[2] == 0) && counts[0] == n / 3 &&
        counts[1] == n / 3 && counts[2] == n / 3) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
    return 0;
    ;
  }
  cout << "No" << endl;
}
