// Arup Guha
// 4/19/2025
// Showing brute force subsets via a bitmask.

/* Input:

nC (number of cases.
n T (number of items followed by target)
a1 a2 a3 ... an (items for the case)
*/

import java.util.*;

public class subsetsum {

	public static void main(String[] args) {
		
		Scanner stdin = new Scanner(System.in);
		int nC = stdin.nextInt();
		
		// Process case.
		for (int loop=0; loop<nC; loop++) {
			
			// Get all input for the case.
			int n = stdin.nextInt();
			int target = stdin.nextInt();
			int[] vals = new int[n];
			for (int i=0; i<n; i++)
				vals[i] = stdin.nextInt();
			
			boolean good = false;
			
			// Try each subset.
			for (int mask=0; mask<(1<<n); mask++) {
				
				// Here we add each item that is part of the subset mask.
				int total = 0;
				for (int i=0; i<n; i++)
					
					// If this is not 0, then bit i has to be on.
					if ( (mask & (1<<i)) != 0 )
						total += vals[i];
					
				// This is the target we wanted.
				if (total == target) {
					good = true;
					break;
				}
			}
			
			// Output accordingly.
			if (good) System.out.println("YES");
			else System.out.println("NO");
		}
	}
}