import itertools
def permutations(iterable, r=None):
    pool = tuple(iterable)
    n = len(pool)
    ff = False
    r = n if r is None else r
    for indices in itertools.product(range(n), repeat=r):
        if len(set(indices)) == r:
            p = tuple(pool[i] for i in indices)
            for i in range(0, n):
                if i == 0:
                    ff = checkXOR(p[n-1],p[i],p[i+1])
                elif i == n-1:
                    ff = checkXOR(p[i-1],p[i],p[0])
                else:
                    ff = checkXOR(p[i-1],p[i],p[i+1])
                if ff:
                    break
        if ff:
            break
    return ff

def checkXOR(a, b, c):
    if bin(b) == bin(a ^ c):
        return False
    else:
        return True
    
n = int(input())
a = list(map(int, input().split()))
ff = permutations(a)
    
if ff:
    print("No")
else:
    print("Yes")