import itertools
def q44(n, a):
    b = list(itertools.permutations(a))
    for c in b:
       # print(c)
        c = list(c)
        #print(c)
        e = c[-1]
        f = c[0]
        c.insert(0, e)
        c.append(f)
        
        yes = True
        for i in range(1, len(c) - 1):
            #print(c[i-1])
            #print(c[i+1])
            #print(c[i])
            #print(bin(c[i-1] ^ c[i+1]))
            if bin(c[i]) != bin(c[i-1] ^ c[i+1]):
                yes = False
        if yes:
            return 'Yes'
    return 'No'
N = int(input())
a = [int(i) for i in input().split()]
print(q44(N, a))