whats wrong with this code
my solution CodeChef: Practical coding for everyone
import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
class Main {
public static void main(String[] args)
{
Scanner one = new Scanner(System.in);
int t = one.nextInt();
for(int i=0;i<t;i++)
{
int n = one.nextInt();
int m = one.nextInt();
String fn = "NO";
ArrayList<Integer> two = new ArrayList<Integer>();
for(int k=0;k<n;k++)
{
int o = one.nextInt();
two.add(o);
}
Collections.sort(two);
int f = 0;
int g = 0;
for(int j=two.size()-1;j>=0;j--)
{
f = two.get(j);
if((f+g)<=m)
{
g=g+f;
if(g==m)
{
fn = "YES";
break;
}
}
}
System.out.println(fn);
}
one.close();
}
}