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

$N = $s[0];
$memo = array();

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

$a_list = $s;
$tmp_list = array();
foreach($a_list as $value) {
    $tmp_list[(int)$value] = true;
}

function check($pre1, $pre2, $a_list) {
    $first = $pre1;
    global $memo;
    // var_dump($pre1, $pre2, $a_list);
    // var_dump("next");
    unset($a_list[$pre1]);
    unset($a_list[$pre2]);
    while (count($a_list) !== 0) {
        $next = $pre1 ^ $pre2;
        // var_dump($next);
        if (!array_key_exists($next, $a_list)) {
            return false;
        }
        unset($a_list[$next]);
        $pre1 = $pre2;
        $pre2 = $next;
        $memo[$pre1][$pre2] = true;
    }
    if ($first != ($pre1 ^ $pre2)) {
        return false;
    }
    return true;
}

$ret = "No";
for ($i = 0; $i < $N; $i++) {
    for ($j = $i + 1; $j < $N; $j++) {
        $pre1 = (int)$a_list[$i];
        $pre2 = (int)$a_list[$j];
        if (isset($memo[$pre1][$pre2]) || isset($memo[$pre2][$pre1])) {
            // var_dump($pre1, $pre2);
            continue;
        }
        if (check($pre1, $pre2, $tmp_list)) {
            $ret = "Yes";
            goto end_lable;
        }
    }
}

end_lable:
echo $ret;
