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())
l_key = len(key)
if l_key == 1:
    if 0 in d:
        ans = "Yes"
elif l_key == 2:
    if 0 in d:
        if d[0] == n // 3:
            ans = "Yes"
elif l_key == 3:
    if key[0] ^ key[1] ^ key[2] == 0:
        ans = "Yes"

print(ans)
