// Arup Guha
// 10/16/2012
// Solution to Practice Problem: Exact Change 2

import java.util.*;
import java.io.*;

public class change2 {

	public static void main(String[] args) throws Exception {

		// Open file and get number of cases.
		Scanner stdin = new Scanner(System.in);
		int numCases = stdin.nextInt();

		// Go through each case.
		for (int i=1; i<=numCases; i++) {

			// Read in coin set and target.
			int numCoins = stdin.nextInt();
			int[] denom = new int[numCoins];
			for (int j=0; j<numCoins; j++)
				denom[j] = stdin.nextInt();
			int T = stdin.nextInt();
			
			// Output the solution.
			if (solve(denom, T))
				System.out.println("Item #"+i+": YES");
			else
				System.out.println("Item #"+i+": NO");
		}

	}

	// Returns true iff some subset of values in denom adds up exactly to T.
	public static boolean solve(int[] denom, int T) {

		int n = denom.length;
		
		// i is a bit-mask representation of the subset.
		for (int i=0; i<(1 << n); i++) {
			
			int mask = i;
			int cursum = 0;
			for (int j=0; j<n; j++) {
				if ((mask & 1) == 1)
					cursum += denom[j];
				mask = mask >> 1;
			}
			
			// This subset works.
			if (cursum == T)
				return true;
		}
		
		// If we get here, none of the subsets worked.
		return false;
		
	}

}