n = int(eval(input()))

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

ax = 0

for i in range(n):

  ax ^= an[i]

if ax:

  print('No')

else:

  print('Yes')
N=int(eval(input()))

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

s = set(a)

sl = list(s)

if len(s)==1:

    if sl[0]==0:

        print('Yes')

    else:

        print('No')

elif len(s)==2:

    if N%3==0:

        if sl[0]==0 or sl[1]==0:

            if a.count(0)==N/3:

                print('Yes')

            else:

                print('No')

        else:

            print('No')

    else:

        print('No')

elif len(s)==3:

    if N%3==0:

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

            if a.count(sl[0])==N/3 and a.count(sl[1])==N/3:

                print('Yes')

            else:

                print('No')

        else:

            print('No')

    else:

        print('No')

else:

    print('No')

n = int(eval(input()))
an = [int(i) for i in input().split()]
ax = 0
for i in range(n):
    ax ^= an[i]
if ax:
    print("No")
else:
    print("Yes")

N = int(eval(input()))
a = list(map(int, input().split()))
s = set(a)
sl = list(s)
if len(s) == 1:
    if sl[0] == 0:
        print("Yes")
    else:
        print("No")
elif len(s) == 2:
    if N % 3 == 0:
        if sl[0] == 0 or sl[1] == 0:
            if a.count(0) == N / 3:
                print("Yes")
            else:
                print("No")
        else:
            print("No")
    else:
        print("No")
elif len(s) == 3:
    if N % 3 == 0:
        if sl[0] ^ sl[1] ^ sl[2] == 0:
            if a.count(sl[0]) == N / 3 and a.count(sl[1]) == N / 3:
                print("Yes")
            else:
                print("No")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")

-n = int(eval(input())) -an = [int(i) for i in input().split()] -ax = 0 -for i in range(n): -    ax ^= an[i] -if ax: +N = int(eval(input())) +a = list(map(int, input().split())) +s = set(a) +sl = list(s) +if len(s) == 1: +    if sl[0] == 0: +        print("Yes") +    else: +        print("No") +elif len(s) == 2: +    if N % 3 == 0: +        if sl[0] == 0 or sl[1] == 0: +            if a.count(0) == N / 3: +                print("Yes") +            else: +                print("No") +        else: +            print("No") +    else: +        print("No") +elif len(s) == 3: +    if N % 3 == 0: +        if sl[0] ^ sl[1] ^ sl[2] == 0: +            if a.count(sl[0]) == N / 3 and a.count(sl[1]) == N / 3: +                print("Yes") +            else: +                print("No") +        else: +            print("No") +    else: +        print("No") +else: -else: -    print("Yes")