#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("tune=native")
#pragma GCC target("avx")
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
T gcd(const T &a, const T &b) {
  return a < b ? gcd(b, a) : b ? gcd(b, a % b) : a;
}
template <class T>
T lcm(const T &a, const T &b) {
  return a / gcd(a, b) * b;
}
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using namespace std;
int main() {
  ll n;
  cin >> n;
  vector<ll> a(n);
  for (long long i = 0, i_len = (n); i < i_len; i++) cin >> a[i];
  if (n % 3) {
    cout << "No" << endl;
    return 0;
  }
  for (long long i = 0, i_len = (32); i < i_len; i++) {
    ll bitnum = 0;
    for (long long j = 0, j_len = (n); j < j_len; j++) {
      bitnum += !!(a[j] & (1LL << i));
    }
    if (bitnum != 0 && bitnum * 3 != n * 2) {
      cout << "No" << endl;
      return 0;
    }
  }
  map<ll, ll> numa;
  for (long long i = 0, i_len = (n); i < i_len; i++) {
    numa[a[i]]++;
  }
  switch (numa.size()) {
    case 1: {
      bool ans = accumulate((a).begin(), (a).end(), 0LL) == 0;
      cout << (ans ? "Yes" : "No") << endl;
    } break;
    case 2: {
      auto u = *numa.begin();
      auto v = *++numa.begin();
      if (u.first != 0) {
        cout << "No" << endl;
      } else if (u.second * 2 == v.second) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    } break;
    case 3: {
      cout << "Yes" << endl;
    } break;
    default: {
      cout << "No" << endl;
    }
  }
}
