import itertools

def check(a):
    for i in range(n):
        if i == 0:
            if a[i+1]^a[n-1] != a[i]:
                break
        elif i == n-1:
            if a[i-1]^a[0] != a[i]:
                break
        else:
            if a[i-1]^a[i+1] != a[i]:
                break
    else:
        return True
    return False
        
n = int(input())
a = [int(i) for i in input().split()]
b = list(itertools.permutations(a))
for x in b:
    if check(x) == True:
        print('Yes')
        break
else:
    print('No')