#include <bits/stdc++.h>
using namespace std;
constexpr int MOD = 1e9 + 7;
constexpr long long int inf = 1LL << 60;
template <typename S, typename T>
inline void chmax(S &a, const T &b) {
  if (a < b) a = b;
}
template <typename S, typename T>
inline void chmin(S &a, const T &b) {
  if (a > b) a = b;
}
long long int gcd(long long int x, long long int y) {
  if (x == 0) return y;
  return gcd(y % x, x);
}
long long int lcm(long long int x, long long int y) {
  return x * y / gcd(x, y);
}
long long int modpow(long long int a, long long int n, long long int p) {
  if (n == 1) return a % p;
  if (n % 2 == 1) return (a * modpow(a, n - 1, p)) % p;
  long long int t = modpow(a, n / 2, p);
  return (t * t) % p;
}
long long int modinv(long long int a, long long int m) {
  if (m == 0) return (long long int)1;
  long long int b = m, u = 1, v = 0;
  while (b) {
    long long int t = a / b;
    a -= t * b;
    swap(a, b);
    u -= t * v;
    swap(u, v);
  }
  u %= m;
  if (u < 0) u += m;
  return u;
}
long long int fac[510000], finv[510000], inv[510000];
void COMinit() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < 510000; i++) {
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
    finv[i] = finv[i - 1] * inv[i] % MOD;
  }
}
long long int COM(long long int n, long long int k) {
  if (n < k) return 0;
  if (n < 0 || k < 0) return 0;
  return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
long long int com(long long int n, long long int m) {
  if (n < m || n <= 0 || m < 0) {
    return 0;
  }
  if (m == 0 || n == m) {
    return 1;
  }
  long long int k = 1;
  for (long long int i = 1; i <= m; i++) {
    k *= (n - i + 1);
    k %= MOD;
    k *= modinv(i, MOD);
    k %= MOD;
  }
  return k;
}
long long int rad(long long int u, long long int p) {
  long long int cnt = 0;
  while (u % p == 0) {
    u /= p;
    cnt++;
  }
  return cnt;
}
int main() {
  long long int n;
  cin >> n;
  long long int a[n + 1];
  for (long long int i = 1; i <= (long long int)(n); i++) {
    cin >> a[i];
  }
  int x, y, z;
  y = -1;
  z = -1;
  for (long long int i = 1; i <= (long long int)(n); i++) {
    if (i == 1) {
      x = a[i];
      continue;
    }
    if (a[i] != x && y == -1) {
      y = a[i];
      continue;
    }
    if (a[i] != x && a[i] != y && z == -1) {
      z = a[i];
      continue;
    }
    if (a[i] != x && a[i] != y && a[i] != z) {
      cout << "No" << endl;
      return 0;
    }
  }
  if (y == -1) {
    if (x == 0) {
      cout << "Yes" << endl;
    } else
      cout << "No" << endl;
    return 0;
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  int xv = 0;
  int yv = 0;
  int zv = 0;
  for (long long int i = 1; i <= (long long int)(n); i++) {
    if (a[i] == x) xv++;
    if (a[i] == y) yv++;
    if (a[i] == z) zv++;
  }
  if (z == -1) {
    if ((x == 0 && yv == xv * 2) || (y == 0 && xv == yv * 2)) {
      cout << "Yes" << endl;
    } else
      cout << "No" << endl;
    return 0;
  }
  if (x ^ y != z || y ^ z != x || z ^ x != y) {
    cout << "No" << endl;
    return 0;
  }
  if (xv != yv || yv != zv) {
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
  return 0;
}
