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

a.sort()
s = set(a)
if (len(s) > 3) or (len(s) == 1) or (len(s) == 2):
    print('No')
    exit()

l = [a[0]]
c = []
count = 1
for i in range(n-1):
    if a[i+1] != a[i]:
        l.append(a[i+1])
        c.append(count)
        count = 1
    else:
        count += 1
c.append(count)

if n % 3 != 0:
    print('No')
    exit()

c.sort()
if c[0] != c[1] or c[1] != c[2]:
    print('No')
    exit()

if (l[0] ^ l[1]) == l[2]:
    print('Yes')
    exit()
print('No')

