N = int(input())
a = list(map(int, input().split()))

sa = set(a)

tmp = [a[0]]
for i in range(1,N):
    tmp.append(a[i])
    for j in range(N-2):
        tmp.append(tmp[-2] ^ tmp[-1])
        if tmp[-1] not in set(sa):
            break
    else:
        if tmp[-2] ^ tmp[-1] == tmp[0]:
            print("Yes")
            exit()
print("No")