#include <bits/stdc++.h>
using namespace std;
long long lcm(long long a, long long b) {
  long long r, x, tmp;
  x = a * b;
  if (a < b) {
    tmp = a;
    a = b;
    b = tmp;
  }
  r = a % b;
  while (r != 0) {
    a = b;
    b = r;
    r = a % b;
  }
  return x / b;
}
long long gcd(long long a, long long b) {
  if (a == 0) {
    return b;
  } else if (b == 0) {
    return a;
  } else {
    long long tmp, r;
    if (a < b) {
      tmp = a;
      a = b;
      b = tmp;
    }
    r = a % b;
    while (r != 0) {
      a = b;
      b = r;
      r = a % b;
    }
    return b;
  }
}
int main(void) {
  const long long INF = 1000000007;
  long long b, c, n;
  string ans;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  b = 0;
  long long x = n / 3;
  sort(a, a + n);
  if (n % 3 != 0)
    b++;
  else
    for (long long i = 0; i < x; i++) {
      if (((a[i] ^ a[i + x]) ^ a[i + 2 * x]) == 0 && a[0] == a[i] &&
          a[x] == a[i + x] && a[2 * x] == a[i + 2 * x])
        ;
      else
        b++;
    }
  if (b == 0)
    ans = "Yes";
  else
    ans = "No";
  cout << ans << endl;
  return 0;
}
