#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1.01e9;
const long long infll = (long long)1.01e18;
const long double eps = 1e-9;
const long double pi = acos((long double)-1);
mt19937 mrand(chrono::steady_clock::now().time_since_epoch().count());
int rnd(int x) { return mrand() % x; }
void precalc() {}
const int maxn = (int)1e5 + 5;
int n;
int a[maxn];
bool read() {
  if (scanf("%d", &n) < 1) {
    return false;
  }
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  return true;
}
void solve() {
  if (n % 3) {
    printf("No\n");
    return;
  }
  int k = n / 3;
  sort(a, a + n);
  int x = a[0], y = a[k], z = a[2 * k];
  for (int i = 0; i < k; i++) {
    if (a[i] != x) {
      printf("No\n");
      return;
    }
  }
  for (int i = k; i < 2 * k; i++) {
    if (a[i] != y) {
      printf("No\n");
      return;
    }
  }
  for (int i = 2 * k; i < n; i++) {
    if (a[i] != z) {
      printf("No\n");
      return;
    }
  }
  if (x ^ y ^ z) {
    printf("No\n");
    return;
  }
  printf("Yes\n");
}
int main() {
  precalc();
  while (read()) {
    solve();
  }
  return 0;
}
