#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const long long INF = 2e18;
long long N, M;
long long a[100010];
string s;
int main() {
  cin >> N;
  long long mx = 0;
  map<long long, long long> mp;
  vector<long long> v;
  for (long long i = 0; i < N; i++) {
    cin >> a[i];
    mp[a[i]]++;
    if (mp[a[i]] == 1) {
      v.push_back(a[i]);
    }
  }
  if (v.size() > 3) {
    cout << "No" << endl;
    return 0;
  }
  if (v.size() < 3) {
    if (mp[0] == 0) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
    return 0;
  }
  auto it = mp.begin();
  long long tmp = it->second;
  for (; it != mp.end(); it++) {
    if (tmp != it->second) {
      cout << "No" << endl;
      return 0;
    }
  }
  sort(v.begin(), v.end());
  if ((v[0] ^ v[1]) == v[2]) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
