from collections import Counter

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

c = Counter(a)
s = set(a)
l = len(s)

if l == 1 and a[0] == 0:
    print('Yes')
elif len(a) % 3 == 0:
    if l == 2 and c[0] == n // 3:
        print('Yes')
    elif l == 3:
        if s[0] ^ s[1] ^ s[2] == 0:
            tmp = c[a[0]]
            if all(x == tmp for x in c.values()):
                print('Yes')
        else:
            print('No')
    else:
        print('No')
else:
    print('No')
