from collections import Counter
N = int(input())
a = list(map(int, input().split()))

c = Counter(a)
keys = sorted(list(c.keys()))
values = sorted(list(c.values()))
if N % 3 != 0:
    print("No")
    exit()
if len(keys) == 1 and keys[0] == 0:
    print("Yes")
elif len(keys) == 2 and 0 in keys and c[0] == N//3:
    print("Yes")
elif len(keys) == 3 and values[0] == values[1] == values[2] == N//3 and keys[0] ^ keys[1] ^ keys[2] == 0:
    print("Yes")
else:
    print("No")