#include <bits/stdc++.h>
using namespace std;
template <class T>
using V = vector<T>;
template <class T>
using VV = V<V<T>>;
template <class T, class Y>
ostream& operator<<(ostream& o, const pair<T, Y>& p) {
  return o << "(" << p.first << "," << p.second << ")";
}
template <class T>
ostream& operator<<(ostream& o, V<T>& v) {
  for (T& t : v) o << t << ",";
  return o << endl;
}
template <class T>
void uniq(V<T>& v) {
  sort(((v).begin()), ((v).end()));
  v.erase(unique(((v).begin()), ((v).end())), v.end());
}
mt19937 rnd(random_device{}());
__int128_t gcd(__int128_t a, __int128_t b, __int128_t& x, __int128_t& y) {
  if (!b) {
    x = 1;
    y = 0;
    return a;
  }
  __int128_t d = gcd(b, a % b, y, x);
  y -= a / b * x;
  return d;
}
long long modInv(long long a, long long m) {
  __int128_t x, y;
  gcd(a, m, x, y);
  return (x % m + m) % m;
}
long long modPow(__int128_t a, __int128_t n, long long m) {
  __int128_t p = 1;
  for (; n; n >>= 1, a = a * a % m)
    if (n & 1) p = p * a % m;
  return p;
}
bool isPrime(long long n) {
  if (n < 2 || n % 2 == 0) return n == 2;
  __int128_t t = n - 1, d = t / (t & -t);
  for (__int128_t a : {2, 325, 9375, 28178, 450775, 9780504, 1795265022})
    if (a % n) {
      for (t = d, a = modPow(a, t, n); t != n - 1 && a != 1 && a != n - 1;
           a = a * a % n, t = t * 2 % n)
        ;
      if (a != n - 1 && t % 2 == 0) return 0;
    }
  return 1;
}
V<long long> fac, rfac;
void setFac(int n, int mod) {
  fac = rfac = V<long long>(++n);
  fac[0] = 1;
  for (int i = (1), iformax = (n); i < iformax; i++)
    fac[i] = fac[i - 1] * i % mod;
  rfac[n - 1] = modInv(fac[n - 1], mod);
  for (int i = (n - 1), iformax = (1); i >= iformax; i--)
    rfac[i - 1] = rfac[i] * i % mod;
}
long long randInt(long long l, long long r) {
  return uniform_int_distribution<long long>(l, r)(rnd);
}
double randDouble(double l, double r) {
  return uniform_real_distribution<double>(l, r)(rnd);
}
void dout(double d) { printf("%.12f\n", d); }
const double PI = acos(-1);
const double EPS = 1e-10;
const int IINF = 1e9 + 6;
const long long LINF = 1e18;
const int MOD = 1e9 + 7;
const int N = 1e5;
int n;
map<int, int> c;
map<int, int>::iterator i1, i2, i3;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = (0), iformax = (n); i < iformax; i++) {
    int a;
    cin >> a;
    c[a]++;
  }
  switch ((int)(c).size()) {
    case 1:
      cout << (c[0] ? "Yes" : "No");
      break;
    case 2:
      sleep(100);
      cout << (c[0] * 2 == c.rbegin()->second ? "Yes" : "No");
      break;
    case 3:
      cout << 1 / 0;
      i1 = c.begin(), i2 = c.begin(), i3 = c.begin();
      i2++;
      i3++;
      i3++;
      cout << (i1->first ^ i2->first == i3->first && i1->second == i2->second &&
                       i2->second == i3->second
                   ? "Yes"
                   : "No");
      break;
    default:
      cout << "No";
      break;
  }
  cout << endl;
}
