Help me in solving PCJ18A problem

My issue

t = int(input())

for _ in range(t):

N,X = map(int,input().split())

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

mx = - float('INF')

for item in arr:

    if item > mx:

        mx = item

    if mx >= X: 
        print("YES")

    else:
        print ("NO") 

My code

# cook your dish here
t = int(input())

for _ in range(t):

    N,X = map(int,input().split())

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

    mx = - float('INF')

    for item in arr:

        if item > mx:

            mx = item

        if mx >= X: 
            print("YES")

        else:
            print ("NO")

Learning course: Placement preparation for Product companies
Problem Link: Chef and Secret Ingredient Practice Problem in Placement preparation for Product companies - CodeChef