N = int(input())
a = list(map(int, input().split()))[:N]

xorNeighbor = 0
xorNeighborS = 0
nonZero = []

for i in range(1, len(a)-1):
    xorNeighbor = a[i-1] ^ a[i] ^ a[i+1]
    xorNeighborS ^= xorNeighbor
    if xorNeighbor:
        nonZero.append(xorNeighbor)

if xorNeighborS:
    nonZero.append(xorNeighborS)

if len(nonZero) == 0:
    print("Yes")
else:
    #print(nonZero)
    try:
        while len(nonZero):
            removeVal = nonZero[0]
            nonZero.remove(removeVal)
            nonZero.remove(removeVal)
        print("Yes")
    except:
        print("No")