from collections import deque

N = int(input())

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

def seach(source, base, current_list):
    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)
                source.remove(right)
                return seach(source, right, current_list)


# left, base をまず組み合わせる
for base in a_list:
    result = False
    a_queue.remove(base)
    for left in a_list:
        if base == left:
            pass
        else:
            a_queue.remove(left)
            result = seach(a_queue, base, [left, base])
            if result:
                break
    if result:
        break
    a_queue = deque(a_list)

print("YES" if result else "NO")
