from collections import defaultdict
n = int(input())
a = list(map(int, input().split()))

d = defaultdict(int)
for i in range(n):
    d[a[i]] += 1


if len(d) == 1 and 0 in d:
    ans = "Yes"
elif len(a) % 3 != 0:
    ans = "No"
else:
    key = list(d.keys())
    if len(d) == 2:
        if d[key[0]] == d[key[1]]*2 and key[0] ^ key[1] ^ key[1] == 0:
            ans = "Yes"
        elif d[key[1]] == d[key[0]]*2 and key[1] ^ key[0] ^ key[0] == 0:
            ans = "Yes"
        else:
            ans = "No"
    elif len(d) == 3:
        if d[key[0]] == d[key[1]] and d[key[1]] == d[key[2]] and key[0] ^ key[1] ^ key[2] == 0:
            ans = "Yes"
        else:
            ans = "No"
    else:
        ans = "No"

print(ans)
