#include <iostream>
#include <algorithm>
#include <Vector>
using namespace std;

int main() {
    int n, a[100010];
    cin >> n;
    for (int i = 0; i < n; i++) cin >> a[i];

    sort(a, a + n);

    int idx = 1;
    vector<pair<int, int > > v;
    for (int i = 0; i < n - 1; i++) {
        if (a[i] == a[i + 1]) idx++;
        else {
            v.emplace_back(a[i], idx);
            idx = 1;
        }
    }
    v.emplace_back(a[n - 1], idx);

    bool ok = false;
    if (n % 3 != 0) {
        cout << "No" << endl;
        return 0;
    }
    if (v.size() == 1) {
        if (v[0].first == 0) ok = true;
    }
    else if (v.size() == 2) {
        if (v[0].second == n/3 && v[1].second == 2 * n / 3) {
            if ((v[1].first ^ v[1].first) == v[0].first) ok = true;
        }
        if (v[0].second == 2*n/3 && v[1].second == n / 3) {
            if ((v[0].first ^ v[0].first) == v[1].first) ok = true;
        }
    }
    else if (v.size() == 3) {
        if (v[0].second == v[1].second && v[1].second == v[2].second) {
            if ((v[0].first ^ v[2].first) == v[1].first) ok = true;
        }
    }

    if (ok) cout << "Yes" << endl;
    else cout << "No" << endl;

}
