#include <bits/stdc++.h>
inline long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
inline void sub(long long &a, long long b) {
  a -= b;
  if (a < 0) a += 1000000007;
}
inline void add(long long &a, long long b) {
  a += b;
  if (a >= 1000000007) a -= 1000000007;
}
inline long long mul(long long a, long long b, long long c) {
  return (a * b - (long long)((long double)a * b / c) * c + c) % c;
}
inline long long qp(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % 1000000007;
    a = a * a % 1000000007, b >>= 1;
  }
  return ans;
}
inline long long qp(long long a, long long b, long long c) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = mul(ans, a, c);
    a = mul(a, a, c), b >>= 1;
  }
  return ans;
}
using namespace std;
const long double pi = acos(-1);
const unsigned long long ba = 233;
const double eps = 1e-5;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const int N = 16000 + 10, maxn = 2000000 + 10, inf = 0x3f3f3f3f;
map<int, int> ma;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    ma[x]++;
  }
  if (ma.size() == 1) return 0 * puts(ma.begin()->first ? "No" : "Yes");
  if (ma.size() == 2) {
    if (ma.begin()->first != 0) return 0 * puts("No");
    if (((--ma.end())->second) - ma.begin()->second > 1 ||
        ((--ma.end())->second) - ma.begin()->second < 0)
      return 0 * puts("No");
    return 0 * puts("Yes");
  }
  if (n % 3 != 0 || ma.size() > 3)
    puts("No");
  else {
    auto te = ma.begin();
    int x = te->first;
    if (te->second != n / 3) return 0 * puts("No");
    te++;
    int y = te->first;
    if (te->second != n / 3) return 0 * puts("No");
    te++;
    int z = te->first;
    if (te->second != n / 3) return 0 * puts("No");
    puts(((x ^ y) == z) ? "Yes" : "No");
  }
  return 0;
}
