from collections import deque
import copy

N = int(input())

# 2つの入力を空白で分割し、数値化
a_list = list(map(int, input().split()))
a_queue = deque(a_list)

def seach(source, base, current_list):
    print(current_list)
    copied_source = copy.copy(source)
    if len(source) == 0:
        # 最後まできたら、自身とこれまでのリストの最後と、リストの先頭を比較して
        # 条件をみたせばOK
        if base == (current_list[-2] ^ current_list[0]):
            return True
        else:
            return False
    else:
        for right in source:
            if left ^ right == base:
                current_list.append(right)
                copied_source.remove(right)
                result = seach(copied_source, right, current_list)
                if result:
                    return True
        return False


# left, base をまず組み合わせる。円順列なので、はじめの１つ固定で良い。
for base in a_list:
    result = False
    default_queue = deque(a_list)
    default_queue.remove(base)
    for left in a_list:
        if base == left:
            pass
        else:
            q = copy.copy(default_queue)
            q.remove(left)
            result = seach(q, base, [left, base])
            if result:
                break
            else:
                pass

    break

print("Yes" if result else "No")
