#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7, MAXN = 1e6 + 7, INF = 0x3f3f3f3f;
long long fpow(long long a, long long b, long long p) {
  long long ans = 1LL;
  while (b) {
    if (b & 1) ans = ans * a % p;
    b >>= 1;
    a = a * a % p;
  }
  return ans % p;
}
int n;
int a[N];
int main() {
  scanf("%d", &n);
  int allzero = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", a + i);
    allzero += a[i] == 0;
  }
  if (allzero == n) {
    puts("Yes");
    return 0;
  }
  if (n % 3) {
    puts("No");
    return 0;
  }
  sort(a + 1, a + n + 1);
  bool ok = 1;
  for (int i = 0; i <= 2; i++) {
    bool same = 1;
    for (int j = 2; j <= n / 3; j++)
      same &= a[j + n / 3 * i] == a[j - 1 + n / 3 * i];
    if (!same) {
      ok = false;
      break;
    }
  }
  if (a[n / 3] ^ a[n / 3 * 2] ^ a[n] == 0 && a[1] == a[n / 3] &&
      a[1 + n / 3] == a[n / 3 * 2] && a[1 + n / 3 * 2] == a[n])
    puts("Yes");
  else
    puts("No");
  return 0;
}
