#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//#include <boost/math/common_factor_rt.hpp>
#define USE_MATH_DEFINES
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef long long ll;

using namespace std;
// namespace mp = boost::multiprecision;
// namespace mt = boost::math
// using Bint = mp::cpp_int;

int main() {
    ll n, i, j, k, kind = 1;
    bool flag = false, flag2 = true;
    cin >> n;
    ll a[n], a2[n], a3[n][2] = {};
    rep(i, n) {
        cin >> a[i];
        a2[i] = a[i];
        if (a[i] != 0)
            flag2 = false;
    }
    if (n == 3 && a[0] ^ a[1] ^ a[2] == 0)
        flag = true;
    sort(a2, a2 + n);
    int cnt = 0;
    a3[0][0] = a2[0];
    a3[0][1] = 1;
    rep(i, n - 1) {
        if (a2[i] != a2[i + 1]) {
            kind++;
            cnt++;
            a3[cnt][0] = a2[i + 1];
        }
        a3[cnt][1]++;
    }
    // cout << a3[0][1] << a3[1][1];
    if (kind == 2 && a2[0] == 0 && a3[0][1] * 2 == a3[1][1])
        flag = true;
    if (kind == 3 && a3[0][1] == a3[1][1] && a3[1][1] == a3[2][1] &&
        a3[0][0] ^ a3[1][0] ^ a3[2][0] == 0)
        flag = true;
    if (flag || flag2)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    // cout << ans << endl;
}