#include <bits/stdc++.h>
using namespace std;
const int INF = (1 << 30) - 1;
const long long LLINF = (1LL << 60LL);
const int MOD = 1000000007;
const int MAX = 510000;
const double pi = acos(-1);
const double eps = 1e-9;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  long long n, a[100010];
  cin >> n;
  set<long long> st;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    st.insert(a[i]);
  }
  auto itr = st.begin();
  long long b = *itr;
  itr++;
  long long c = *itr;
  itr++;
  long long d = *itr;
  if (st.size() == 3 && (b ^ c == d) && n % 3 == 0) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
