#include <bits/stdc++.h>
using namespace std;
int N, A[1 << 17];
int main() {
  cin >> N;
  bool flag = true;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    flag &= A[i] == 0;
  }
  if (flag) {
    cout << "Yes" << endl;
    return 0;
  }
  if (N % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  map<int, int> M;
  for (int i = 0; i < N; i++) M[A[i]]++;
  vector<pair<int, int> > B;
  for (map<int, int>::iterator it = M.begin(); it != M.end(); it++) {
    B.push_back(make_pair(it->first, it->second));
  }
  bool ans = false;
  if (B.size() == 3) {
    if (B[0].second == B[1].second && B[1].second == B[2].second) {
      if ((B[0].first ^ B[1].first ^ B[2].first) == 0) ans = true;
    }
  }
  cout << (ans ? "Yes" : "No") << endl;
}
