#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<long long, long long>;
const long long INF = 1LL << 60;
const long long MOD = 1000000007;
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
vector<long long> divisor(long long n) {
  vector<long long> ret;
  for (long long i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i * i != n) ret.push_back(n / i);
    }
  }
  sort(ret.begin(), ret.end());
  return ret;
}
ll nCr(ll n, ll r) {
  ll ans = 1;
  for (int i = n; i > n - r; --i) {
    ans = ans * i;
  }
  for (int i = 1; i < r + 1; ++i) {
    ans = ans / i;
  }
  return ans;
}
int main() {
  ll N;
  cin >> N;
  map<ll, ll> a;
  bool ans = false;
  ;
  for (int i = 0; i < (int)(N); i++) {
    ll b;
    cin >> b;
    a[b]++;
  }
  ll count = 0;
  vector<long long> key(a.size());
  vector<long long> value(a.size());
  for (auto p : a) {
    auto x = p.first;
    auto y = p.second;
    key.at(count) = x;
    value.at(count) = y;
    count++;
  }
  sort((key).begin(), (key).end());
  if (key.size() == 1 && key.at(0) == 0) {
    ans = true;
  } else if (key.size() == 2 && key.at(0) == 0 && a[0] == N / 3 && N % 3 == 0) {
    ans = true;
  } else if (key.size() == 3 && N % 3 == 0 && a[0] == N / 3 &&
             value.at(1) == N / 3 && key.at(0) ^ key.at(1) ^ key.at(2) == 0) {
    ans = true;
  }
  cout << (ans ? "Yes" : "No") << endl;
}
