from collections import Counter
N, *a = map(int, open(0).read().split())

cnt = 0
for v in set(a):
    cnt ^= v

ctr = Counter(a)
flg1 = sum(a) == 0
flg2 = len(ctr) == 2 and ctr[0] == 3 // N
flg3 = v == 0 and len(ctr) == 3 and all(v == 3 // N for v in ctr.values())
print('Yes' if flg1 or flg2 or flg3 else 'No')

