<?php
$s = trim(fgets(STDIN));
$s = str_replace(array("\r\n","\r","\n"), '', $s);
$s = explode(" ", $s);

$N = $s[0];

$s = trim(fgets(STDIN));
$s = str_replace(array("\r\n","\r","\n"), '', $s);
$s = explode(" ", $s);

$a_list = $s;

function check($i, $j, $a_list) {
    $pre1 = (int)$a_list[$i];
    $pre2 = (int)$a_list[$j];
    unset($a_list[$i]);
    unset($a_list[$j]);
    while (count($a_list) !== 0) {
        $find = false;
        foreach(array_keys($a_list) as $n) {
            if ($a_list[$n] == ($pre1 ^ $pre2)) {
                $pre1 = $pre2;
                $pre2 = (int)$a_list[$n];
                unset($a_list[$n]);
                $find = true;
                break;
            }
        }
        if (!$find) {
            return false;
        }
    }
    return true;
}

$ret = "No";
for ($i = 0; $i < $N; $i++) {
    for ($j = $i + 1; $j < $N; $j++) {
        if (check($i, $j, $a_list)) {
            $ret = "Yes";
            goto end_lable;
        }
    }
}

end_lable:
echo $ret;
