#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
signed main(void) {
  long long N;
  long long A[114514];
  vector<long long> R;
  cin >> N;
  for (long long i = 0; i < (N); ++i) {
    cin >> A[i];
  }
  sort(A, A + N);
  R.push_back(A[0]);
  for (long long i = 0; i < (N - 1); ++i) {
    if (A[i] != A[i + 1]) {
      R.push_back(A[i + 1]);
    }
  }
  sort(R.begin(), R.end());
  long long K = R.size();
  if (K > 3) {
    cout << "No" << endl;
    return 0;
  }
  if (K == 3) {
    if (N % 3 == 0 && ((R[0] ^ R[1]) == R[2]) && ((R[0] ^ R[2]) == R[1]) &&
        ((R[2] ^ R[1]) == R[0])) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  if (K == 2) {
    cout << "No" << endl;
  }
  if (K == 1) {
    if (R[0] == 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
