#include <bits/stdc++.h>
using namespace std;
const long long N = 1e9 + 7;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  set<int> st;
  for (int i = 0; i < n; i++) {
    st.insert(a[i]);
  }
  int st_size = st.size();
  bool ok = false;
  if (st_size == 1) {
    auto itr = st.begin();
    if (!*itr) ok = true;
  } else if (st_size == 2) {
    auto itr = st.begin();
    int count = 0;
    if (!*itr) {
      for (int i = 0; i < n; i++) {
        if (a[i] == 0) count++;
      }
    }
    if (count == n / 3) ok = true;
  } else if (st_size == 3) {
    auto itr = st.begin();
    int x, y, z;
    x = *itr;
    itr++;
    y = *itr;
    itr++;
    z = *itr;
    int count[3] = {};
    if (x ^ y ^ z == 0) {
      ok = true;
      for (int i = 0; i < n; i++) {
        if (a[i] == x)
          count[0]++;
        else if (a[i] == y)
          count[1]++;
        else
          count[2]++;
      }
      for (int i = 0; i < 3; i++) {
        if (count[i] != n / 3) ok = false;
      }
    }
  }
  if (ok)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
