def CheckMatch(aList, bList, i):
    #print("aList", aList)
    #print("bList", bList)
    matched_list = list(set(aList) & set(bList))
    if len(matched_list) < i :
        print("No")
        exit()
    return matched_list

n = int(input())
cap = list(map(int, input().split()))

#print(cap)

a = []
a.append(cap[0])
cap.pop(0)
aXor = []
for i in range(n-1):
    aXor.append(a[0]^cap[i])

matched_list = CheckMatch(cap, aXor, 2)
#print(matched_list)

_cap = cap

for i in range(len(matched_list)):
    a.append(matched_list[i])
    _cap.remove(matched_list[i])
    #print(a, a[-2], a[-1], a[-2]^a[-1])
    a.append(a[-2]^a[-1])
    matched_list = CheckMatch(_cap, [a[-1]], 1)
    #print(matched_list)
    if len(_cap) == 1:
        if a[-2]^a[-1] == a[0]:
            print("Yes")
            exit()
        else:
            a = []
            a.append(cap[0])
            _cap = cap
