mport itertools
inn = input()
inn = int(inn)
in_list = [int(i) for i in input().split(' ')]
print(in_list)

kumi = list(itertools.permutations(in_list))
print(kumi)
flag = 0
for tori in kumi:
    count = 0
    for i in range(inn):
        a = tori[i-1]
        try:
            b = tori[i+1]
        except:
            b = tori[0]
        hai = bin(a^b)
        hai = int('{}'.format(hai), 2)
        c = tori[i]
        if hai==c:
            count += 1
    if count==inn:
        flag = 1
if flag==1:
    print('Yes')
else:
    print('No')
    