#include <bits/stdc++.h>
#include <climits>
#define F first
#define S second
#define all(v) v.begin(),v.end()
#define li long int
#define lli long long int
#define ulli unsigned long long int
#define pb push_back
#define loop(a,b,i) for(int i=a ; i<b ; i++)
#define rev_loop(a,b,i) for(int i=a ; i>=b ; i--)
#define MAX(a,b) (a>b)?a:b
#define lele(arr, n) loop(0,n,i) cin>>arr[i];
#define MAXN 1005
#define MOD 1000000007
#define newline cout<<"\n";

using namespace std;

set<lli> poss_sums;

void swap(int *a, int *b){
    int tmp = *a;
    *a = *b;
    *b = tmp;
}

int findPivot(int arr[], int low, int high){
    int maxi=arr[low], mini=arr[low];
    loop(low, high+1, i){
        maxi = max(maxi, arr[i]);
        mini = min(mini, arr[i]);
    }
    return (maxi + mini)/2;
}

int partition (int arr[], int low, int high) 
{ 
    int pivot = findPivot(arr, low, high);
    int i = (low - 1); 
    // cout<<"PIVOT="<<pivot<<" "<<low<<" "<<high;
    // newline;
    for (int j = low; j <= high; j++) 
    { 
        if (arr[j] <= pivot) 
        { 
            i++;
            swap(&arr[i], &arr[j]); 
        } 
    } 
    // cout<<"INDEX = "<<i;
    // newline;
    // swap(&arr[i + 1], &arr[high]); 
    return i; 
} 
 
void myRecursion(int arr[], int low, int high) 
{ 
    if (low < high) 
    { 
        int pi = partition(arr, low, high);
        lli sum=0;
        loop(low, pi+1, i) sum+=arr[i];
        poss_sums.insert(sum);
        sum=0; 
        loop(pi+1, high+1, i) sum+=arr[i];
        poss_sums.insert(sum);
        if(pi == high) return; 
        myRecursion(arr, low, pi); 
        myRecursion(arr, pi + 1, high); 
    } 
} 

void solve(){
    int n, q;
    cin>>n>>q;
    int a[n];
    lli sum=0;
    loop(0, n, i){ 
        cin>>a[i];
        sum+=a[i];
    }
    li s[q];
    loop(0, q, i) cin>>s[i];
    poss_sums.clear();
    poss_sums.insert(sum);
    myRecursion(a, 0, n-1);
    loop(0, q, i){
        if(poss_sums.find(s[i]) != poss_sums.end()) cout<<"Yes\n";
        else cout<<"No\n";
    }
    return;
}

int main() 
{
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif  
    int t=1;
    cin>>t;
    // sieve();
    while(t--){
        solve();
    }
    return 0;
}