#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 10;
int n;
int a[MAX];
void input() {
  cin >> n;
  for (int i = 0; i < (int)(n); i++) cin >> a[i];
}
bool ans = false;
void solve() {
  if (n % 3 != 0) {
    sort(a, a + n);
    if (a[n - 1] == 0) ans = true;
  } else {
    set<int> st;
    multiset<int> ms;
    for (int i = 0; i < (int)(n); i++) {
      st.insert(a[i]);
      ms.insert(a[i]);
    }
    if ((int)st.size() == 1 && a[0] == 0)
      ans = 0;
    else if ((int)st.size() == 3) {
      int p[3];
      int ind = 0;
      for (auto itr = st.begin(); itr != st.end(); ++itr) {
        p[ind] = *itr;
        ind++;
      }
      int ct[3];
      for (int i = 0; i < (int)(3); i++) ct[i] = (int)ms.count(p[i]);
      int k = (p[0] ^ p[1]) ^ p[2];
      if (ct[0] == ct[1] && ct[1] == ct[2] && k == 0) ans = true;
    } else if ((int)st.size() == 2) {
      int p[2];
      int ind = 0;
      for (auto itr = st.begin(); itr != st.end(); ++itr) {
        p[ind] = *itr;
        ind++;
      }
      int ct[2];
      for (int i = 0; i < (int)(3); i++) ct[i] = (int)ms.count(p[i]);
      if (p[0] == 0 && ct[0] == n / 3 && ct[1] == 2 * n / 3) ans = true;
    }
  }
  if (ans)
    cout << "Yes";
  else
    cout << "No";
}
int main() {
  input();
  solve();
}
