N=int(eval(input()))

a=[int(i) for i in input().split()]

b=list(set(a))

if len(b)==1:

    if b[0]==0:

        print("Yes")

    else:

        print("No")

else:

    if N%3==0 and len(b)==3:

        D={b[0]:0,b[1]:0,b[2]:0}

        for i in range(N):

            D[a[i]]+=1

        if D[b[0]]==D[b[1]] and D[b[1]]==D[b[2]] and b[0]^b[1]==b[2]:

            print("Yes")

        else:

            print("No")

    else:

        if N%3==0 and len(b)==2:

            D={b[0]:0,b[1]:0}

            for i in range(N):

                D[a[i]]+=1

            if D[b[0]]==D[b[1]]*2:

                if b[0]^b[0]==b[1]:

                    print("Yes")

                else:

                    print("No")

            elif D[b[1]]==D[b[0]]*2:

                if b[1]^b[1]==b[0]:

                    print("Yes")

                else:

                    print("No")

            else:

                print("No")

        else:

            print("No")

N=int(eval(input()))

A=[int(i) for i in input().split()]

tmp=0

for i in range(N):

    tmp=tmp^A[i]

if tmp==0:

    print("Yes")

else:

    print("No")

N = int(eval(input()))
a = [int(i) for i in input().split()]
b = list(set(a))
if len(b) == 1:
    if b[0] == 0:
        print("Yes")
    else:
        print("No")
else:
    if N % 3 == 0 and len(b) == 3:
        D = {b[0]: 0, b[1]: 0, b[2]: 0}
        for i in range(N):
            D[a[i]] += 1
        if D[b[0]] == D[b[1]] and D[b[1]] == D[b[2]] and b[0] ^ b[1] == b[2]:
            print("Yes")
        else:
            print("No")
    else:
        if N % 3 == 0 and len(b) == 2:
            D = {b[0]: 0, b[1]: 0}
            for i in range(N):
                D[a[i]] += 1
            if D[b[0]] == D[b[1]] * 2:
                if b[0] ^ b[0] == b[1]:
                    print("Yes")
                else:
                    print("No")
            elif D[b[1]] == D[b[0]] * 2:
                if b[1] ^ b[1] == b[0]:
                    print("Yes")
                else:
                    print("No")
            else:
                print("No")
        else:
            print("No")

N = int(eval(input()))
A = [int(i) for i in input().split()]
tmp = 0
for i in range(N):
    tmp = tmp ^ A[i]
if tmp == 0:
    print("Yes")
else:
    print("No")

-a = [int(i) for i in input().split()] -b = list(set(a)) -if len(b) == 1: -    if b[0] == 0: -        print("Yes") -    else: -        print("No") +A = [int(i) for i in input().split()] +tmp = 0 +for i in range(N): +    tmp = tmp ^ A[i] +if tmp == 0: +    print("Yes") -    if N % 3 == 0 and len(b) == 3: -        D = {b[0]: 0, b[1]: 0, b[2]: 0} -        for i in range(N): -            D[a[i]] += 1 -        if D[b[0]] == D[b[1]] and D[b[1]] == D[b[2]] and b[0] ^ b[1] == b[2]: -            print("Yes") -        else: -            print("No") -    else: -        if N % 3 == 0 and len(b) == 2: -            D = {b[0]: 0, b[1]: 0} -            for i in range(N): -                D[a[i]] += 1 -            if D[b[0]] == D[b[1]] * 2: -                if b[0] ^ b[0] == b[1]: -                    print("Yes") -                else: -                    print("No") -            elif D[b[1]] == D[b[0]] * 2: -                if b[1] ^ b[1] == b[0]: -                    print("Yes") -                else: -                    print("No") -            else: -                print("No") -        else: -            print("No") +    print("No")