n = int(input())
a = list (map(int, input().split()))
# b = copy.copy(a) 

def dfs(x,y,l):
    ans = 0
    if x != -1:
        if (l[x] ^ l[y]) not in l:
            if len(l) !=2:
                return 1
            else:
                if (l[x] ^ l[y])!= a[0]:
                    return 1
        for i in range(1,len(l)-1):
            ans += dfs(y-1,i,l[:x]+l[x+1:])
    else:
        for i in range(1,len(l)-1):
            ans += dfs(y,i,l)
    return (ans)

if dfs(-1,0,a) == 0:
    print("Yes")
else:
    print("No")