from collections import Counter
from functools import reduce
n = int(input())
a = list(map(int, input().split()))
c = Counter(a)
if (len(c) == 0 and c[0] == n) or (len(c) == 2 and c[0] == n//3 and c[max(c.keys())] == 2*n//3) or (len(c) == 3 and reduce(lambda x, y: x^y, c.keys()) == 0 and set(c.values()) == set([n//3])):
    print("Yes")
else:
    print("No")