function main() {
    // write code here:
    const n = Number(stdin[0]);
    var arr = stdin[1].split(' ').map(Number);
    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');
    }
}

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);