N = int(input())
a_list = [int(e) for e in input().split()]

a_dict = dict()
for a in a_list:
    if a not in a_dict:
        a_dict[a] = 0
    a_dict[a] += 1

ans_list = list()

#最初の3つを求める
center = a_list[0]
a_dict[center] -= 1
if a_dict[center] == 0:
    del a_dict[center]

for a in a_dict:
    if center^a in a_dict:
        a_dict[center^a] -= 1
        a_dict[a] -= 1

        if a_dict[center^a]==0:
            del a_dict[center^a]
        if a_dict[a]==0:
            del a_dict[a]
        elif a_dict[a] == -1:
            first_NG_flag = False
            
        break
else:
    print("No")
    first_NG_flag = True
               
left = center^a
right = a
ans_list.append(left)
ans_list.append(center)
ans_list.append(right)

#以後を求める
if first_NG_flag == False:
    left = ans_list[-2]
    center = ans_list[-1]

    while 1:
        if len(a_dict)==0:
            right = ans_list[0]
            if left^right == center:
                print("Yes")
            else:
                print("No")
            break

        elif left^center in a_dict:
            a_dict[left^center] -= 1
            if a_dict[left^center] == 0:
                del a_dict[left^center]
            ans_list.append(left^center)

            left = ans_list[-2]
            center = ans_list[-1]
        else:
            print("No")
            break
