using namespace std;

#include <iostream>
#include <algorithm>
#include <set>

#define MAXN 100005

long long arr[MAXN],pref[MAXN];
set<long long> allSums;

void solve(int l,int r) {
	// cout << l << " " << r << endl;
	int minV = arr[l];
	int maxV = arr[r];
	int midV = (minV + maxV) >> 1;
	long long sum = pref[r + 1] - pref[l];
	allSums.insert(sum);
	int a = l;
	int b = r;
	while(a < b) {
		int m = (a + b + 1) >> 1;
		if(arr[m] <= midV) {
			a = m;
		}else{
			b = m - 1;
		}
	}
	if(a == r) return;
	solve(l,a);
	solve(a + 1,r);
}

int main() {
	int T;
	cin >> T;
	while(T--) {
		allSums.clear();
		int N,Q;
		cin >> N >> Q;
		for(int i = 0;i < N;++i) {
			cin >> arr[i];
		}
		sort(arr,arr + N);
		for(int i = 0;i < N;++i) {
			pref[i + 1] = pref[i] + arr[i];
		}
		solve(0,N - 1);
		for(int i = 0;i < Q;++i) {
			long long cur;
			cin >> cur;
			cout << ((allSums.find(cur) == allSums.end()) ? "NO" : "YES") << endl;
		}
	}
	return 0;
}