N = int(eval(input()))

A = list(map(int,input().split()))

B = set(A)

C = list(B)

k = len(C)

if N%3==0:

    if k==3 and C[0]^C[1]==C[2] and A.count(C[0])==A.count(C[1]) and A.count(C[0])==A.count(C[2]):

        print("Yes")

    elif k==2:

        C = sorted(C)

        if C[0]==0 and A.count(C[0])==N//3:

            print("Yes")

        else:

            print("No")

    elif k==1 and C[0] == 0:

        print("Yes")

    else:

        print("No")

else:

    if k==1 and C[0] ==0:

        print("Yes")

    else:

        print("No")
N = int(eval(input()))

A = list(map(int,input().split()))

C = {}

for i in range(N):

    if A[i] not in C:

        C[A[i]] = 0

    C[A[i]] += 1

if len(C)>3:

    print("No")

else:

    if N%3==0:

        if 0 in C:

            if len(C)==1:

                print("Yes")

            elif len(C)==2:

                if C[0]==N//3:

                    print("Yes")

                else:

                    print("No")

            else:

                print("No")

        else:

            if len(C)!=3:

                print("No")

            else:

                flag = 0

                for a in C:

                    if C[a]!=N//3:

                        flag = 1

                        break

                if flag==0:

                    C = list(C.keys())

                    if C[0]^C[1]==C[2]:

                        print("Yes")

                    else:

                        print("No")

                else:

                    print("No")

    else:

        if len(C)==1 and 0 in C:

            print("Yes")

        else:

            print("No")
N = int(eval(input()))
A = list(map(int, input().split()))
B = set(A)
C = list(B)
k = len(C)
if N % 3 == 0:
    if (
        k == 3
        and C[0] ^ C[1] == C[2]
        and A.count(C[0]) == A.count(C[1])
        and A.count(C[0]) == A.count(C[2])
    ):
        print("Yes")
    elif k == 2:
        C = sorted(C)
        if C[0] == 0 and A.count(C[0]) == N // 3:
            print("Yes")
        else:
            print("No")
    elif k == 1 and C[0] == 0:
        print("Yes")
    else:
        print("No")
else:
    if k == 1 and C[0] == 0:
        print("Yes")
    else:
        print("No")

N = int(eval(input()))
A = list(map(int, input().split()))
C = {}
for i in range(N):
    if A[i] not in C:
        C[A[i]] = 0
    C[A[i]] += 1
if len(C) > 3:
    print("No")
else:
    if N % 3 == 0:
        if 0 in C:
            if len(C) == 1:
                print("Yes")
            elif len(C) == 2:
                if C[0] == N // 3:
                    print("Yes")
                else:
                    print("No")
            else:
                print("No")
        else:
            if len(C) != 3:
                print("No")
            else:
                flag = 0
                for a in C:
                    if C[a] != N // 3:
                        flag = 1
                        break
                if flag == 0:
                    C = list(C.keys())
                    if C[0] ^ C[1] == C[2]:
                        print("Yes")
                    else:
                        print("No")
                else:
                    print("No")
    else:
        if len(C) == 1 and 0 in C:
            print("Yes")
        else:
            print("No")

-B = set(A) -C = list(B) -k = len(C) -if N % 3 == 0: -    if ( -        k == 3 -        and C[0] ^ C[1] == C[2] -        and A.count(C[0]) == A.count(C[1]) -        and A.count(C[0]) == A.count(C[2]) -    ): -        print("Yes") -    elif k == 2: -        C = sorted(C) -        if C[0] == 0 and A.count(C[0]) == N // 3: +C = {} +for i in range(N): +    if A[i] not in C: +        C[A[i]] = 0 +    C[A[i]] += 1 +if len(C) > 3: +    print("No") +else: +    if N % 3 == 0: +        if 0 in C: +            if len(C) == 1: +                print("Yes") +            elif len(C) == 2: +                if C[0] == N // 3: +                    print("Yes") +                else: +                    print("No") +            else: +                print("No") +        else: +            if len(C) != 3: +                print("No") +            else: +                flag = 0 +                for a in C: +                    if C[a] != N // 3: +                        flag = 1 +                        break +                if flag == 0: +                    C = list(C.keys()) +                    if C[0] ^ C[1] == C[2]: +                        print("Yes") +                    else: +                        print("No") +                else: +                    print("No") +    else: +        if len(C) == 1 and 0 in C: -    elif k == 1 and C[0] == 0: -        print("Yes") -    else: -        print("No") -else: -    if k == 1 and C[0] == 0: -        print("Yes") -    else: -        print("No")