#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long INF = 1LL << 60;
int main() {
  long long n;
  cin >> n;
  map<long long, long long> mp;
  for (long long i = 0; i < n; i++) {
    long long a;
    cin >> a;
    mp[a]++;
  }
  if (mp.size() != 3) {
    cout << "No" << endl;
    return 0;
  }
  vector<long long> b(3), c(3);
  long long p = 0;
  for (auto itr = mp.begin(); itr != mp.end(); ++itr) {
    b[p] = (itr->second);
    c[p] = (itr->first);
    p++;
  }
  for (long long i = 1; i < 3; i++) {
    if (b[i] != b[i - 1]) {
      cout << "No" << endl;
      return 0;
    }
  }
  if (c[1] != (c[0] ^ c[2]) || c[2] != (c[1] ^ c[0]) || c[0] != (c[1] ^ c[2])) {
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
}
