from collections import Counter
from functools import reduce

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

c = Counter(a)
if len(c) > 3:
    print('No')
else:
    if len(c) == 1 and c.get(0):
        print('Yes')
    elif len(c) == 2 and c.get(0) == n / 3:
        print('Yes')
    elif len(c) == 3 and reduce(lambda x, y: x^y, c.keys()) == 0:
        print('Yes')
    else:
        print('No')
