Help me in solving MAKEPERM problem

My issue

can you explain why test case 4 i.e 111166 has no permutations

My code

# cook your dish here
t=int(input())
for _ in range(t):
    n=int(input())
    a=list(map(int,input().split()))
    if min(a)<=1 and max(a)<=n :
        print("YES")
    else:
        print("NO")

Problem Link: Make Permutation Practice Coding Problem