import java.util.;
import java.lang.;
import java.io.*;
/* Name of the class has to be “Main” only if the class is public. */
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
try{
// your code goes here
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
while(T!=0){
int N = sc.nextInt(), M = sc.nextInt();
int a[] = new int[N];
int j=0;
while(j<N){
a[j] = sc.nextInt();
j++;
}
int t = sum(N);
int add=0;
for(int k=0;k<N;k++){
add = a[k] + add;
}
if(t == add){
System.out.println("NO");
}
else
System.out.println("YES");
T--;
}
}
catch(Exception e){
return ;
}
}
static int sum(int N){
int sum = 0;
for(int i=1;i<=N;i++){
sum = sum + i;
}
return sum;
}
}
I Am getting time limit exceeded error .How can i reduce time limit for this code please help.