#include <bits/stdc++.h>
using namespace std;
template <typename Type>
void print(Type a[], int n) {
  for (int i = 0; i < n; i++) cout << a[i] << "\n";
}
template <typename Type1, typename Type2>
void print(Type1 a[], Type2 b[], int n) {
  for (int i = 0; i < n; i++) cout << a[i] << " " << b[i] << "\n";
}
template <typename Type1, typename Type2, typename Type3>
void print(Type1 a[], Type2 b[], Type3 c[], int n) {
  for (int i = 0; i < n; i++)
    cout << a[i] << " " << b[i] << " " << c[i] << "\n";
}
template <typename Type>
Type max(Type a[], int n) {
  Type ret = a[0];
  for (int i = 1; i < n; i++) ret = max(ret, a[i]);
  return ret;
}
template <typename Type>
Type min(Type a[], int n) {
  Type ret = a[0];
  for (int i = 1; i < n; i++) ret = min(ret, a[i]);
  return ret;
}
template <typename Type>
Type gcd(Type a, Type b) {
  return (b == 0) ? a : gcd(b, a % b);
}
template <typename Type>
Type gcd(Type a[], int n) {
  Type ret = a[0];
  for (int i = 1; i < n; i++) ret = gcd(ret, a[i]);
  return ret;
}
template <typename Type>
Type lcm(Type a, Type b) {
  return (a / gcd(a, b)) * b;
}
template <typename Type>
Type lcm(Type a[], int n) {
  Type ret = a[0];
  for (int i = 1; i < n; i++) ret = lcm(ret, a[i]);
  return ret;
}
template <typename Type1, typename Type2>
void PairSort(Type1 a[], Type2 b[], int left, int right) {
  int i = left, j = right;
  Type1 p = a[(left + right) / 2];
  while (true) {
    while (a[i] < p) i++;
    while (p < a[j]) j--;
    if (i >= j) break;
    swap(a[i], a[j]);
    swap(b[i], b[j]);
    i++;
    j--;
  }
  if (left < i - 1) PairSort(a, b, left, i - 1);
  if (j + 1 < right) PairSort(a, b, j + 1, right);
}
template <typename Type1, typename Type2, typename Type3>
void PairSort(Type1 a[], Type2 b[], Type3 c[], int left, int right) {
  int i = left, j = right;
  Type1 p = a[(left + right) / 2];
  while (true) {
    while (a[i] < p) i++;
    while (p < a[j]) j--;
    if (i >= j) break;
    swap(a[i], a[j]);
    swap(b[i], b[j]);
    swap(c[i], c[j]);
    i++;
    j--;
  }
  if (left < i - 1) PairSort(a, b, c, left, i - 1);
  if (j + 1 < right) PairSort(a, b, c, j + 1, right);
}
template <typename Type>
void Reverse(Type a[], int n) {
  for (int i = 0; i < n / 2; i++) swap(a[i], a[n - i - 1]);
}
int main() {
  int N;
  cin >> N;
  int a[N];
  for (int i = 0; i < N; i++) cin >> a[i];
  ;
  sort(a, a + (int)(sizeof(a) / sizeof((a)[0])));
  if (N % 3 == 0) {
    for (int i = 0; i < N / 3 - 1; i++) {
      if (a[i] != a[i + 1]) {
        cout << "No";
        return 0;
      }
    }
    for (int i = N / 3; i < 2 * N / 3 - 1; i++) {
      if (a[i] != a[i + 1]) {
        cout << "No";
        return 0;
      }
    }
    for (int i = 2 * N / 3; i < N - 1; i++) {
      if (a[i] != a[i + 1]) {
        cout << "No";
        return 0;
      }
    }
    if (a[0] == a[N / 3] ^ a[2 * N / 3]) {
      cout << "Yes";
    } else
      cout << "No";
  } else if (N % 3 == 1) {
    for (int i = 0; i < N - 1; i++) {
      if (a[i] != a[i + 1]) {
        cout << "No";
        return 0;
      }
    }
    cout << "Yes";
  } else {
    for (int i = 0; i < N - 1; i++) {
      if (a[i] != a[i + 1]) {
        cout << "No";
        return 0;
      }
    }
    cout << "Yes";
  }
}
