#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  map<long long, long long> m;
  for (int i = 0; i < n; i++) {
    long long temp;
    cin >> temp;
    m[temp]++;
  }
  if (m.size() == 1 && m[0] == n) {
    cout << "Yes";
    return 0;
  }
  if (m.size() == 2 && n % 3 == 0) {
    map<long long, long long>::iterator it = m.begin();
    if (it->first == 0 && it->second == n / 3) {
      it++;
      if (it->second == 2 * n / 3) cout << "Yes";
      return 0;
    }
  }
  if (m.size() == 3) {
    map<long long, long long>::iterator it = m.begin();
    long long x = it->first;
    long long countx = it->second;
    it++;
    long long y = it->first;
    long long county = it->second;
    it++;
    long long z = it->first;
    long long countz = it->second;
    if (x ^ y ^ z == 0 && countx == county && countz == county) {
      cout << "Yes";
      return 0;
    }
  }
  cout << "No";
}
