#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e13;
int main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  long long i, j, k;
  set<long long> st;
  map<long long, long long> mp;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    st.insert(a[i]);
    mp[a[i]]++;
  }
  long long bit = 0;
  for (i = 0; i < n; i++) {
    bit ^= a[i];
  }
  bool flag = false;
  if (n % 3 != 0)
    flag = true;
  else {
    for (pair<long long, long long> p : mp) {
      if (p.second != n / 3) {
        flag = true;
      }
    }
  }
  if (st.size() == 3 && bit == 0 && !flag) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
