import sys
sys.setrecursionlimit(10 ** 7)

debug = True
debug = False

def dprint(*objects):
    if debug == True:
        print(*objects)

def solve():
    N = int(input())
    a_list = list(map(int, input().split()))

    # a[0] からスタート
    found = False
    start = a_list[0]
    second = 0
    third = 0
    for i in range(1, N):
        for j in range(i+1, N):
            ai = a_list[i]
            aj = a_list[j]
            b = start ^ ai
            if b == aj:
                found = True
                second = j
                third = i
                break
        if found == True:
            break

    if found == False:
        print("No")
        return

    # これで、0, second, third が決まったので、あとは順次決める
    hat_list = [a_list[0], a_list[second], a_list[third]]

    a_list[0] = None
    a_list[second] = None
    a_list[third] = None

    dprint(hat_list)

    cnt = 3
    while True:
        # N個作ったら終了
        if cnt == N:
            break

        left = hat_list[-2]
        center = hat_list[-1]

        # 次の数字
        right = left ^ center

        # 検索
        try:
            rid = a_list.index(right)
        except:
            dprint("break", right, a_list)
            print("No")
            return

        dprint("found", right, rid, a_list)

        a_list[rid] = None
        hat_list.append(right)
        cnt += 1
        dprint("next", cnt, hat_list, a_list)

    # 最後に周期条件
    center = hat_list[0]
    right = hat_list[1]
    left = hat_list[-1]

    if right ^ left == center:
        print("Yes")
    else:
        dprint("break", center, right, left)
        print("No")


solve()