Help me in solving WAV2 problem

My issue

why my code time limit exceeded

My code

m,n=map(int,input().split())
list1=list(map(int,input().split()))
for i in range(n):
    key=int(input())
    if(key in list1):
       print(0)
    else:
        list1.append(key)
        list1.sort()
        ch=(len(list1)-1)-(list1.index(key))
        if(ch%2==0):
            print("POSITIVE")
        else:
            print("NEGATIVE")
        list1.remove(key)    
        

Learning course: Binary Search
Problem Link: CodeChef: Practical coding for everyone

@srisaiganesh
Cozz n is upto 2.10^5 and u r looping till n and for each n u are applying sorting operation whi h will take nlogn time .
so the overall time complexity of the code will become n^2logn which is high .
U need to optimize your code.