import copy

N = input()
A = input().split()
n = int(N)
Int_A = [int(a) for a in A]

result = [Int_A[0]]
Int_A.remove(Int_A[0])


def check(a, other):
    if len(other) == 1:
        if result[0] == other[0] ^ a:
            print("Yes")
            exit()
        return []

    res = []
    co_other = copy.deepcopy(other)
    for o in other:
        co_other.remove(o)
        if a ^ o in co_other:
            res.append(o)
        co_other.append(o)
    del co_other

    return res


def deep_check(depth):

    resp = check(result[depth - 1], Int_A)

    if len(resp) == 0:
        return

    for k in resp:
        result.append(k)
        Int_A.remove(k)
        depth += 1
        deep_check(depth)
        result.remove(k)
        Int_A.append(k)
    depth -= 1
    return


deep_check(1)
print('No')


