#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
long long mod2 = 998244353;
long long inf = 1000000000000000000;
double pi = 2 * acos(0);
int dh[4] = {1, -1, 0, 0};
int dw[4] = {0, 0, 1, -1};
int ddh[8] = {-1, -1, -1, 0, 0, 1, 1, 1};
int ddw[8] = {-1, 0, 1, -1, 1, -1, 0, 1};
long long lmax(long long a, long long b) {
  if (a < b)
    return b;
  else
    return a;
}
long long lmin(long long a, long long b) {
  if (a < b)
    return a;
  else
    return b;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  set<long long> st;
  map<long long, long long> mp;
  long long a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    st.insert(a[i]);
    mp[a[i]]++;
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  if (*st.begin() == 0) {
    if (st.size() != 2) {
      cout << "No" << endl;
      return 0;
    }
    if (mp[*st.begin()] == n / 3) {
      cout << "Yes" << endl;
      return 0;
    }
    cout << "No" << endl;
    return 0;
  }
  if (st.size() != 3) {
    cout << "No" << endl;
    return 0;
  }
  vector<long long> v;
  for (auto itr = st.begin(); itr != st.end(); itr++) {
    long long u = *itr;
    if (mp[u] != n / 3) {
      cout << "No" << endl;
      return 0;
    }
    v.push_back(u);
  }
  auto it = st.begin();
  v.push_back(*st.begin());
  it++;
  v.push_back(*it);
  for (int i = 1; i < 4; i++) {
    long long y = v[i - 1] ^ v[i + 1];
    if (y != v[i]) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}
