// Arup Guha
// 11/27/06
// Solution to COP 3503 Recitation Assignment #, Fall 2006
// A dynamic programming solution to the subset sum problem.
import java.util.*;
import java.io.*;

public class SS {
	
	public static void main(String[] args) throws Exception {
		Scanner fin = new Scanner(new File("subset.in"));
		int numcases = fin.nextInt();
		
		// Read through all of the cases.
		for (int i=1; i<= numcases; i++) {
			
			// Get the number of values and the target for this case.
			int numvals = fin.nextInt();
			int target = fin.nextInt();
			int[] vals = new int[numvals];
			
			// Read in all of the values in the set.
			for (int j=0; j<vals.length; j++)
				vals[j] = fin.nextInt();
				
			// Process the case.
			System.out.print("Test case "+i+": ");
			if (subsetSum(vals, target))
				System.out.println("YES");
			else
				System.out.println("NO");
		}
		
		fin.close();
	}
	
	// Determines if a subset of the elements of values adds to target
	// exactly. It is guaranteed that all the elements of values are
	// positive.
	public static boolean subsetSum(int[] values, int target) {
		
		// isSubset[x] stores true iff there is a subset of values that
		// adds up to x.
		boolean[] isSubset = new boolean[target+1];
		isSubset[0] = true; // This is the only subset we have at first.
		
		// Consider each element in the array.
		for (int index=0; index<values.length; index++) {
		
			// Update whether or not this element helps for a subset
			// that adds upto check.
			for (int check = target; check>= values[index]; check--) {
				
				// If we can form a subset with sum check - values[index],
				// then we can add in values[index] to form a subset that
				// adds to check.
				if (isSubset[check - values[index]])
					isSubset[check] = true;
			}
		}
		// This is what we're interested in.
		return isSubset[target];
	}
}