#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
const long long MOD = 1e9 + 7;
int main() {
  int N;
  cin >> N;
  map<long long, int> A;
  map<long long, int> B;
  vector<long long> X;
  for (int i = 0; i < N; i++) {
    long long a;
    cin >> a;
    A[a]++;
    B[a]++;
    if (A[a] == N / 3) {
      X.push_back(a);
      A[a] = 0;
    }
  }
  bool ans = true;
  if (N % 3 != 0) ans = false;
  if (X.size() != 3) ans = false;
  if (ans && (X[0] ^ X[1] != X[2])) {
    ans = false;
  }
  if (B[0] == N) ans = true;
  if (ans) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
