#include <bits/stdc++.h>
using namespace std;
signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);
  long long N;
  cin >> N;
  vector<long long> A(N);
  bool f = true;
  map<long long, long long> all;
  long long o;
  for (long long i = 0; i < N; i++) {
    cin >> A[i];
    all[A[i]]++;
    if (A[i] > 0) f = false;
    if (A[i] > 0) o = A[i];
  }
  if (f) {
    cout << "Yes" << endl;
    return 0;
  }
  if (N > 3) {
    if (all.size() == 2 && all[0] * 2 == all[o]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
      assert(0);
    }
    return 0;
  }
  if (A[0] == (A[2] ^ A[1]) && A[1] == (A[2] ^ A[0]) && A[2] == (A[1] ^ A[0])) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
