#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, i, x, y, z, v1, v2, v3;
  map<int, int> mp;
  cin >> n;
  long long int a[n];
  for (i = 0; i < n; i++) {
    cin >> x;
    ++mp[x];
  }
  if (mp.size() > 3)
    cout << "No\n";
  else {
    auto it = mp.begin();
    x = it->first, v1 = it->second;
    ++it;
    y = it->first, v2 = it->second;
    ++it;
    z = it->first, v3 = it->second;
    if (x ^ y == z && v1 == v2 && v2 == v3) {
      cout << "Yes\n";
    } else
      cout << "No\n";
  }
}
