#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> A(n);
  for (int i = 0; i < n; ++i) cin >> A[i];
  sort(A.begin(), A.end());
  bool ans = true;
  if (n % 3 == 0 and
      count(A.begin(), A.begin() + n / 3, A[0]) ==
          count(A.begin() + n / 3, A.begin() + n * 2 / 3, A[n / 3]) and
      count(A.begin(), A.begin() + n / 3, A[0]) ==
          count(A.begin() + 2 * n / 3, A.end(), A[2 * n / 3])) {
    ans &= ((A[0] xor A[n / 3] xor A[n / 3 * 2]) == 0);
  } else
    ans = false;
  cout << (ans ? "Yes" : "No") << '\n';
}
