N = int(input())
a = [int(_) for _ in input().split()]
s = set()
for i in range(N):
    s.add(a[i])
if len(s) == 1 and 0 in s:
    print('Yes')
else:
    if N%3 != 0 or len(s) != 3:
        print('No')
    else:
        xor = 0
        for x in s:
            xor ^= x
        if xor == 0:
            print('Yes')
        else:
            print('No')