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

if 0 in a:
    print("Yes")
    exit(1)

if (a[0] ^ a[N-1]) in a:
    print("Yes")
    exit(1)

for i in range(len(a)):
    j = i + 1
    while j < len(a) - 1:
        if (a[j] ^ a[j+1]) == a[i]:
            print("Yes")
            exit(1)
        j += 1

print("No")