from collections import Counter
N = int(input())
A = list(map(int, input().split()))
# 条件満たせるパターンは以下の3パターンある
# 全ての数字が0, 数字が2種類あって片方が0かつ0の個数がN//3, 数字が3種類あってx^y^z==0かつN//3個ずつ存在する
if len([a for a in A if a == 0]) == N:
    print("Yes")
    exit()

if N % 3 != 0:
    print("No")
    exit()

# Nが3の倍数であることが保証された
count = Counter(A)

if len(count.keys()) > 3:
    print("No")
    exit()
elif len(count.keys()) == 3:
    numbers = list(count.keys())
    amounts = list(count.values())
    if numbers[0] ^ numbers[1] ^ numbers[2] == 0 and amounts[0] == N//3 and amounts[1] == N//3 and amounts[2] == N//3:
        print("Yes")
        exit()
    else:
        print("No")
        exit()
elif len(count.keys()) == 2:
    numbers = list(count.keys())
    numbers.sort()
    amounts = list(count.values())
    if numbers[0] == 0 and count[0] == N//3:
        print("Yes")
        exit()
    else:
        print("No")
        exit()
