NOBEL Starters Problem -- Why TLE with below code?

/* package codechef; // don’t place package name! */

import java.util.;
import java.lang.
;
import java.io.*;

/* Name of the class has to be “Main” only if the class is public. */
public class Main
{
public static void main (String[] args) throws java.lang.Exception
{

try {
Scanner sc= new Scanner(System.in);
int t = sc.nextInt();

while(t-->0){
    int n = sc.nextInt();
    int m = sc.nextInt();
    Set<Integer> s = new HashSet<>();
    for(int i=0;i<n;i++){
        s.add(sc.nextInt());
    }
   if(s.size()==m){
       System.out.println("NO"); 
   }else {
       System.out.println("YES"); 
   }
    
    
 
        
    
    
    
    




}

}catch(Exception e){
System.out.println(“wrong inpput”);
}
}
}

hi dear, please add problem link

https://www.codechef.com/START2C/problems/NOBEL/