N = int(input())
A = list(map(int, input().split()))
assert len(A) == N

class multiset:
    def __init__(self, L):
        self.dic = {}
        for a in L:
            if a not in self.dic:
                self.dic[a] = 0
            self.dic[a] += 1
    def has(self, x):
        return x in self.dic and self.dic[x] > 0
    def remove(self, x):
        if self.has(x):
            self.dic[x] -= 1

def check(x, y):
    a = x
    S = multiset(A)
    S.remove(x)
    S.remove(y)
    for i in range(N - 2):
        z = (x ^ y)
        if not S.has(z):
            return False
        S.remove(z)
        x, y = y, z
    return a == x ^ y

yes = any(check(A[0], a) for a in A[1:])
print('Yes' if yes else 'No')