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

import collections
c = collections.Counter(a)
unique = list(set(a))

from operator import xor
v = []
for k in c.keys():
    v.append(c[k])
v.sort()

flag = False
if n % 3 == 0:
    if v == [n] and unique[0] == 0:
        flag = True
    if v == [n // 3, n // 3 * 2]:
        if c[unique[0]] == n // 3 and c[unique[0]] == 0:
                flag = True
        elif c[unique[0]] == n // 3 * 2 and c[unique[1]] == 0:
                flag = True
    if v == [n // 3, n // 3, n // 3]:
        if xor(unique[0], unique[1]) == unique[2] and xor(unique[1], unique[2]) == unique[0] and xor(unique[2], unique[0]) == unique[1]:
            flag = True
else:
    if v == [n]:
        flag = True

if flag:
    print('Yes')
else:
    print('No')
