import collections
N = int(input())
a = list(map(int, input().split()))
A = set()
table = collections.defaultdict(int)

a.sort(reverse=True)
for i in range(1, N):
    table[a[i]] += 2
prev = a[0]
now = a[0]
last = a[0]
for i in range(1, N):
    if (a[0] ^ a[i]) in table and table[a[0] ^ a[i]] > 0:
        table[a[0] ^ a[i]] -= 1
        last = a[i]
        now = a[0] ^ a[i]
        break
    if i == N-1:
        print("No")
        exit(0)
for i in range(2, N-2):
    if prev ^ now in table and table[now ^ prev] > 0:
        prev = now
        now = now ^ prev
        table[now ^ prev] -= 1
    else:
        print("No")
        exit(0)
if (last ^ now) == a[0]:
    print("Yes")
else:
    print("No")
