
def check(b, l):
    for i in l:
        if i == b:
            continue
        n = b ^ i
        if not(n in l):
            print("No")
            exit()
        else:
            flag = 0
            for a in l:
                if n^a in l:
                    flag += 1
                    
                if flag == 2:
                    l.remove(n)

            


    print("Yes")
    exit()

n = int(input())
lst = list(map(int, input().split()))
x = lst

base = x[0]
check(base, x)
