#include <bits/stdc++.h>
using namespace std;
void mmin(long long &a, long long b) { a = min(a, b); }
void mmax(long long &a, long long b) { a = max(a, b); }
long long vsum(vector<long long> v) {
  return accumulate(v.begin(), v.end(), 0);
}
long long msum(vector<vector<long long> > v) {
  long long ans = 0;
  for (long long i = 0; i < v.size(); i++) {
    ans += vsum(v[i]);
  }
  return ans;
}
const long long MOD = 1000000007;
signed main() {
  long long N, M;
  cin >> N;
  set<long long> a;
  multiset<long long> b;
  for (long long i = 0; i < N; i++) {
    long long c;
    cin >> c;
    a.insert(c);
    b.insert(c);
  }
  if ((N % 3) != 0) {
    cout << "No" << endl;
    return 0;
  }
  if (a.size() != 3) {
    cout << "No" << endl;
    return 0;
  }
  set<long long>::iterator i = a.begin();
  long long x = *i++;
  long long y = *i++;
  long long z = *i++;
  if (!(b.count(x) == b.count(y) && b.count(y) == b.count(z))) {
    throw std::exception();
    cout << "No" << endl;
    return 0;
  }
  if (((x ^ y) == z) || ((y ^ z) == x) || ((z ^ x) == y)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
