def solve():
    num = int(input())
    camels = [int(i) for i in input().split()]

    if len(camels) % 3 != 0:
        print("No")
        return(0)

    camels.sort()
    length = len(camels)

    for i in range(3):
        for j in range(int(i*length/3), int((i+1)*length/3)):
            if camels[int(i*length/3)] != camels[j]:
                print("No")
                return(0)

    if camels[0] ^ camels[int(num/3)] != camels[int(num/3)*2]:
        print("No")
        return(0)

    print("Yes")

solve()
