Buggy python submission (verdict: Time Limit Exceeded):
from itertools import permutations
n=int(input())
N=list(map(int,input().split()))
ans=[]
for i in list(permutations(N)):
    flag=1
    i=list(i)
    i.insert(0,i[-1])
    i.append(i[1])
    for j in range(1,n):
        if i[j]!=i[j-1]^i[j+1]:
            flag=0
            break
    if flag==1:break

if flag:print("Yes")
else:print("No")

Fixed submission:
N=int(input())
A = list(map(int,input().split()))
temp = 0
for i in A:
    temp = temp ^ i
if(temp == 0):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import permutations
n=int(input())
N=list(map(int,input().split()))
ans=[]
for i in list(permutations(N)):
    flag=0
    i=list(i)
    i.insert(0,i[-1])
    i.append(i[1])
    for j in range(1,n):
        if i[j]!=i[j-1]^i[j+1]:break
        else:flag=1
    if flag==1:break
    
if flag:print("Yes")
else:print("No")

Fixed submission:
N=int(input())
A = list(map(int,input().split()))
temp = 0
for i in A:
    temp = temp ^ i
if(temp == 0):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import permutations
n=int(input())
N=list(map(int,input().split()))
ans=[]
for i in list(permutations(N)):
    if 1 in ans:break
    flag=1
    i=list(i)
    i.insert(0,i[-1])
    i.append(i[1])
    for j in range(1,n):
        if i[j]!=i[j-1]^i[j+1]:
            flag=0
            break
    ans.append(flag)
if 1 in ans:print("Yes")
else:print("No")

Fixed submission:
N=int(input())
A = list(map(int,input().split()))
temp = 0
for i in A:
    temp = temp ^ i
if(temp == 0):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import permutations
n=int(input())
N=list(map(int,input().split()))
ans=[]
for i in list(permutations(N)):
    if 1 in ans:break
    flag=1
    i=list(i)
    i.insert(0,i[-1])
    i.append(i[1])
    for j in range(1,n):
        if i[j]!=i[j-1]^i[j+1]:
            flag=0
            break
    ans.append(flag)
if 1 in ans:print("Yes")
else:print("No")

Fixed submission:
N=int(input())
A = list(map(int,input().split()))
temp = 0
for i in A:
    temp = temp ^ i
if(temp == 0):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import permutations
n=int(input())
N=list(map(int,input().split()))
ans=[]
for i in list(permutations(N)):
    flag=1
    i=list(i)
    i.insert(0,i[-1])
    i.append(i[1])
    for j in range(1,n):
        if i[j]!=i[j-1]^i[j+1]:
            flag=0
            break
    ans.append(flag)

if 1 in ans:print("Yes")
else:print("No")

Fixed submission:
N=int(input())
A = list(map(int,input().split()))
temp = 0
for i in A:
    temp = temp ^ i
if(temp == 0):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import permutations
n=int(input())
N=list(map(int,input().split()))
flag=1
ans=[]
for i in list(permutations(N)):
    i=list(i)
    i.insert(0,i[-1])
    i.append(i[1])
    for j in range(1,n):
        if i[j]==i[j-1]^i[j+1]:
            continue
        else:flag=0
    ans.append(flag)

if 1 in ans:print("Yes")
else:print("No")

Fixed submission:
N=int(input())
A = list(map(int,input().split()))
temp = 0
for i in A:
    temp = temp ^ i
if(temp == 0):
    print('Yes')
else:
    print('No')