from collections import Counter

N = int(input())
A = list(map(int, input().split()))
a = Counter(A)

ak = list(a.keys())
av = list(a.values())

if N % 3 != 0:
    if 0 in ak and len(ak) == 1:
        print('Yes')
    else:
        print('No')
elif len(ak) == 3:
    if ak[0] ^ ak[1] ^ ak[2] == 0:
        print('Yes')
    else:
        print('No')
elif len(ak) == 2:
    if 0 in ak:
        if a[0] == N // 3:
            print('Yes')
        else:
            print('No')
    else:
        print('No')
elif len(ak) == 1:
    if 0 in ak:
        print('Yes')
    else:
        print('No')
else:
    print('No')