from collections import Counter
n = int(input())
l = list(map(int, input().split()))
cnt = Counter(l)
res = False
if n == 3:
    res = l[0] ^ l[2] == l[1]
elif len(cnt) == 1: res = True
elif (n & 1) and len(cnt) == 2:
    if cnt[l[0]] in (n // 2, n // 2 + 1):
        res = l[0] ^ l[2] == l[1]
print("Yes" if res else "No")