'use strict'
function main(input) {
    const tmp = input.split('\n');
    const N = parseInt(tmp[0], 10);
    const hat = tmp[1].split(' ').map((h) => parseInt(h, 10));
    const binHat = hat.map((h) => parseInt(h.toString(2)));

    let camCir = [];
    camCir[0] = binHat.shift();
    const binHat2 = binHat;
    let restHat = binHat2;
    let find = false;
    for (let h in binHat2) {
        camCir[1] = restHat.shift();

        for (let i = 0; i < N - 2; i++) {
            camCir[i + 2] = camCir[i] ^ camCir[i + 1];
            // let index = restHat.indexOf(camCir[i + 2]);
            let index = 1
            if (index !== -1) {
                restHat.splice(index, 1);
            } else {
                break;
            }

            if (i === N - 3) {
                find = true;
            }
        }

        if (find) {
            break;
        }

        restHat = binHat2;
    }

    if (find) {
        console.log('Yes');
    } else {
        console.log('No');
    }
}

function search(prefix, arr) {
    for (let i = 0; i < arr.length; i++) {
        if (prefix === arr[i]) {
            return i;
        }
    }
    return -1;
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));