#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N, sho;
  cin >> N;
  long long a[N];
  for (int i = 0; i < N; i++) cin >> a[i];
  bool zero = true;
  for (int i = 0; i < N; i++)
    if (a[i] != 0) zero = false;
  if (zero) {
    cout << "Yes";
    return 0;
  }
  if (N % 3 != 0) {
    cout << "No";
    return 0;
  } else
    sho = N / 3;
  sort(a, a + N);
  bool flag = true;
  for (int i = 0; i < sho - 1; i++)
    if (a[i] != a[i + 1]) flag = false;
  for (int i = sho; i < 2 * sho - 1; i++)
    if (a[i] != a[i + 1]) flag = false;
  for (int i = 2 * sho; i < 3 * sho - 1; i++)
    if (a[i] != a[i + 1]) flag = false;
  if (!flag) {
    cout << "No";
    return 0;
  }
  if (a[0] ^ a[sho] == a[2 * sho])
    cout << "Yes";
  else
    cout << "No";
  return 0;
}
