function main(input) {
    var arr = input.split(/\s+/).map(Number);
    const n = arr.splice(0, 1)[0];
    arr = arr.concat(arr[0], arr[1]);
    var count = 0;
    for (let i = 0; i < n; i++) {
        if ((arr[i] ^ arr[i + 1]) === arr[i + 2]) {
            count++;
        } else {
            break;
        }
    }
    if (count === n) {
        console.log('Yes');
    } else {
        console.log('No');
    }
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))
