#include <bits/stdc++.h>
using namespace std;
bool prime(long long n) {
  for (long long i = 2; i <= sqrt(n); i++) {
    if (n % i == 0) return false;
  }
  return n != 1;
}
long long gcd(long long x, long long y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
long long lcm(long long x, long long y) { return x / gcd(x, y) * y; }
long long mod_pow(long long n, long long p, long long m) {
  if (p == 0) return 1;
  if (p % 2 == 0) {
    long long t = mod_pow(n, p / 2, m);
    return (t * t) % m;
  }
  return n * mod_pow(n, p - 1, m) % m;
}
long long extGCD(long long a, long long b, long long& x, long long& y) {
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  }
  long long d = extGCD(b, a % b, y, x);
  y -= a / b * x;
  return d;
}
long long modinv(long long a, long long m) {
  long long b = m, u = 1, v = 0;
  while (b) {
    long long t = a / b;
    a -= t * b;
    swap(a, b);
    u -= t * v;
    swap(u, v);
  }
  u %= m;
  if (u < 0) u += m;
  return u;
}
signed main() {
  long long n;
  cin >> n;
  map<long long, long long> mp;
  vector<long long> vec;
  bool zero = true;
  for (long long i = 0; i < n; i++) {
    long long a;
    cin >> a;
    if (a != 0) zero = false;
    mp[a]++;
    vec.push_back(a);
  }
  if (zero) {
    cout << "Yes" << endl;
  } else if (n % 3 == 0) {
    if (mp.size() > 3) {
      cout << "No" << endl;
    }
    sort(vec.begin(), vec.end());
    vector<long long> v;
    v.push_back(vec[0]);
    for (long long i = 1; i < vec.size(); i++) {
      if (vec[i] != vec[i - 1]) {
        v.push_back(vec[i]);
      }
    }
    if (mp.size() == 3) {
      if ((mp[v[0]] == mp[v[1]] && mp[v[1]] == mp[v[2]]) &&
          (v[0] ^ v[1]) == v[2]) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    } else if (mp.size() == 2) {
      if (((mp[v[0]] * 2 == mp[v[1]]) && (v[1] ^ v[1]) == v[0]) ||
          (mp[v[1]] * 2 == mp[v[0]] && (v[0] ^ v[0]) == v[1])) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    } else {
      cout << "No" << endl;
    }
  } else {
    cout << "No" << endl;
  }
  return 0;
}
