n = int(input())
a_lists = list(input().split())

lists = []
index = [0] * n

cnt = 0

def search(a,b,c):

    if int(a_lists[a]) == int(a_lists[b]) ^ int((a_lists[c])):
        index[c] = 1
        index[a] = 1
        index[b] = 1

        return 1
    else:
        return -1

for i in range(int(n)-2):
    if index[i] == 1:
        next

    for j in range(i+1,int(n)):
        if index[j] == 1:
            next

        cnt = 0
        for k in range(i+2,int(n)):
            if index[k] == 1:
                next
            ret = search(i,j,k)
            if ret > 0:
                cnt = 1
                break
        if cnt == 0:
           print("No") 
           exit()
        else:
            break

print("Yes")
