N=int(input())
a=list(map(int,input().split()))
a.sort()
b=list(set(a))
if len(b) == 3 and b[0] ^ b[1] == b[2] and a.count(b[0]) == a.count(b[1]) == a.count(b[2]):
    print('Yes')
elif b==[0]:
    print('Yes')
else:
    print('No')
