import sys

data = {}
N = int(input())
for i in input().split():
    if i not in data:
        data.update({i: 1})
    else:
        data[str(i)] += 1

# print(data)
ok = 0

if len(data.items()) > 3:
    pass
elif len(data.items()) == 1:
    if list(data.items())[0][0] == "0":
        ok = 1
# elif not N%3 == 0:
#     pass
elif len(data.items()) == 2:
    if 0 in data.items() and data["0"] == N/3:
        ok = 1
else:
    sum = 0
    for i, count in data.items():
        if not count == N/3:
            ok = -1
            break
        sum = sum ^ int(i)
    if ok == 0 and sum == 0:
        ok = 1

if ok == -1:
    ok = 0
print("Yes" if ok else "No")
