from collections import Counter

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

if N % 3 > 0:
    print('Yes') if len(set(a)) == 1 and a[0] == 0 else print('No')
else:
    res = 0
    for i in range(N):
        res ^= a[i]
    l = Counter(a).values()
    if len(l) == 3 and len(set(l)) == 1 and res == 0:
        print('Yes')
    else:
        print('No')