#include <bits/stdc++.h>

using namespace std;

/*--------------------------Template------------------------------*/

#define ll long long
#define ull unsigned ll
#define VI vector<ll>
#define VVI vector<VI>
#define VVVI vector<VVI>
#define PII pair<int,int>
#define PCI pair<char,int>
#define PSI pair<string,int>
#define VPII vector<PII>
#define VVPII vector<VPII>
#define VPSI vector<PSI>
#define VPCI vector<PCI>
#define IT iterator
#define RIT reverse_iterator
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define MAPII map<int,int>
#define MAPCI map<char,int>
#define MAPSI map<string,int>
#define DMAPII map<int,int,greater<int>>
#define SI set<ll>
#define DSI set<int,greater<int>>
#define SPII set<PII>
#define MSI multiset<int>
#define DMSI multiset<int,greater<int>>
#define MSPII multiset<PII>
#define USI unordered_set<int>
#define USC unordered_set<char>
#define UMII unordered_map<int,int>
#define UMCI unordered_map<char,int>
#define UMSI unordered_map<string,int>
#define F first
#define S second
#define B begin
#define E end

#define MEM(a, b) memset(a, (b), sizeof(a))

#define DEBUG(x) cout << #x << ": " << x << "\n";

#define FOR(i, n) for(int i=0; i<(n); i++)
#define FOR1(i, n) for(int i=1; i<=(n); i++)
#define REP(i, a, b) for(int i=(a); i<=(b); i++)

#define INF ((int)1e9 + 9)
#define LINF ((ll)1e18 + 9)
#define PI 3.1415926535897932384626433832795
#define MOD 1000000007

template<typename ... T>
void print(const T& ... t)
{
	initializer_list<int>{ (cout << t << ' ', 0)... };
	cout << '\n';
}

template<typename X, typename Y, template<typename, typename> class Pair, template<typename...> class Vector>
void printVP(Vector<Pair<X, Y>> vec, string vecname = "Vector of pairs")
{
	cout << vecname << " :- \n";
	for(auto& p : vec)
		cout << p.F << " " << p.S << "\n";
	cout << "\n";
}

template<typename X, template<typename...> class Vector>
void printV(Vector<X> vec, string vecname = "Vector")
{
	cout << vecname << " : ";
	for(auto& p : vec)
	cout << p << " ";
	cout << "\n";
}

ull mipow(ull b, ull ex)
{
    if (b==1) 
        return 1;
    ull r = 1;
    while (ex)
    {
        if (ex & 1)
            r = (r * b) % MOD;
        ex >>= 1;
        b = (b * b) % MOD;
    }
    return r;
}

/*--------------------------Template------------------------------*/

void findsm(VI& arr, ll* sarr, SI& sset, ll i, ll j, ll n)
{
	if (i >= j or i < 0 or j > n-1)
		return;
	
	ll mid = (arr[j] + arr[i]) / 2;
	
	ll midi = upper_bound(arr.begin()+i, arr.begin()+j, mid) - arr.begin();
	
	if (midi == j and arr[midi] == mid)		
		midi++;
	
	//print(i, j, midi);

	sset.insert(sarr[midi-1]-((i-1 >= 0) ? sarr[i-1] : 0));
	sset.insert(sarr[j]-sarr[midi-1]);
	
	//printV(sset);
	//return;
	
	if (midi-1 != j)
		findsm(arr, sarr, sset, i, midi-1, n);
		
	if (i != midi)
		findsm(arr, sarr, sset, midi, j, n);
}


void solve()
{
	ll n, q;
	
	cin >> n >> q;
	
	VI arr;
	
	ll k;
	
	for (int i = 0; i < n; i++)
	{
		cin >> k;
		arr.PB(k);
	}
	
	sort(arr.begin(), arr.end());
	
	ll sarr[n];
	
	ll sm = 0;
	
	for (int i = 0; i < n; i++)
	{
		sm += arr[i];
		sarr[i] = sm;
	}
	
	SI sset;
	
	sset.insert(sm);
	
	findsm(arr, sarr, sset, 0, n-1, n);
	
	ll s;
	
	for (int i = 0; i < q; i++)
	{
		cin >> s;
		
		if (sset.find(s) != sset.end())
			cout << "Yes\n";
		else
			cout << "No\n";
	}
	
	
}

int main()
{
	ios::sync_with_stdio(false);
   	cin.tie(NULL);

	int t;

	cin >> t;

	while(t--)
	{
		solve();
	}

	return 0;
}
