#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  set<int> st;
  for (long long(i) = 0; (i) < (long long)(n); ++(i)) {
    cin >> a[i];
    st.insert(a[i]);
  }
  int kosu = 0;
  bool flag = true;
  for (long long(i) = 0; (i) < (long long)(n); ++(i)) {
    if (a[i] != 0) {
      flag = false;
    } else {
      kosu++;
    }
  }
  if (flag) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  if (st.size() == 2 && kosu == n / 3) {
    int tmp = 0;
    for (long long(i) = 0; (i) < (long long)(n); ++(i)) {
      if (a[i] != 0) {
        tmp = a[i];
      }
    }
    for (long long(i) = 0; (i) < (long long)(n); ++(i)) {
      if (a[i] != 0) {
        if (tmp != a[i]) {
          cout << "No" << endl;
          return 0;
        }
      }
    }
    cout << "Yes" << endl;
    return 0;
  }
  if (st.size() == 3) {
    int idx = 0;
    vector<int> tmp(3);
    for (auto i : st) {
      tmp[idx] = i;
      idx++;
    }
    if ((tmp[0] ^ tmp[1] ^ tmp[2]) == 0) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}
