n = int(input())
d = {}
for a in [int(x) for x in input().split()]:
    if a in d:
        d[a] += 1
    else:
        d[a] = 1
ans = "No"
key = list(d.keys())
if 0 in d:
    if d[0] == n:
        ans = "Yes"
    elif len(key) == 2 and d[0] == n // 3:
        ans = "Yes"
else:
    if len(key) == 3:
        if key[0] ^ key[1] ^ key[2] == 0:
            ans = "Yes"
print(ans)
