from collections import Counter
n = int(input())
l = list(map(int, input().split()))
cnt = Counter(l)
res = len(cnt) == 1 and 0 in cnt
if not res and n % 3 == 0:
    if len(cnt) == 3 and all(v == n // 3 for v in cnt.values()):
        x = list(cnt.keys())
        res = x[0] ^ x[2] == x[1]
print("Yes" if res else "No")