Even tual reduction JULY COOK OFF (EVENTUAL)

from collections import Counter
try:
t=int(input())
if 1<=t<=200:
for T in range(t):
n=int(input())
if 1<n<=1000:
st=input()
if len(st)%2==1:
print(“NO”)
else:
d = Counter(st)
l = list(d.values())
temp = 0
for i in l:
if i % 2 == 0:
temp = 0
else:
temp = 1
break
if temp == 0:
print(“YES”)
else:
print(“NO”)

except:
pass

why is this wrong

please give links to question and your code for convenience.