#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 flag3 = false;
  if (n % 3 != 0 || st.size() != 3) {
    flag3 = true;
  } else {
    for (pair<long long, long long> p : mp) {
      if (p.second != n / 3) {
        flag3 = true;
      }
    }
  }
  bool flag2 = true;
  if (n == 3) {
    sort(a.begin(), a.end());
    if (a[0] == 0 && a[1] == a[2]) flag2 = false;
  }
  if (bit == 0 && (!flag3 || !flag2)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
