function main() {
    // write code here:
    const n = Number(stdin[0]);
    var arr = stdin[1].split(' ').map(Number);
    var count = 0;
    for (let i = 0; i < n; i++) {
        if (i !== n - 1) {
            if (arr.includes(arr[i] ^ arr[i + 1])) {
                count++;
            }
        } else {
            if (arr.includes(arr[i] ^ arr[1])) {
                count++;
            }
        }
    }
    if (count === n) {
        console.log('Yes');
    } else {
        console.log('No');
    }
}

const readline = require('readline');
const rl = readline.createInterface({input: process.stdin});
var stdin = [];
rl.on('line', function (line) {
    stdin.push(line);
});
rl.on('close', main);