#include<bits/stdc++.h>
#define inf 1e9
#define pb push_back
#define F first
#define S second
#define ll long long 
using namespace std;
map< ll , bool >  ma1;
void find(vector< ll > &v, ll ma, ll mi)
{
    //cout<<ma<<" "<<mi<<"\n";
    if(v.size() == 0) return;
    if(ma == mi)
    {
        ll val = v.size();
        ma1[mi*val] =1;
        return;
    }
    ma1[accumulate(v.begin(), v.end(), 0)]  =1;
    ll mid = (ma+mi)/2;
    vector< ll >  low, high;
    for(int i : v)
    {
        if(i <= mid)
            low.pb(i);
        else 
            high.pb(i);
    }
    int ma1 =*max_element(low.begin(), low.end()); int ma2 = *min_element(low.begin(), low.end());
    int m1 = *max_element(high.begin(), high.end()); int m2 = *min_element(high.begin(), high.end()); 
    find(low, ma1, ma2);
    find(high,m1, m2);
       
}
int main()
{
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    cin.tie(NULL);
    int t;
    cin>>t;
    while(t--)
    {
        ma1.clear();
        int n, k;
        cin>>n>>k;
        vector< ll >  v(n);
        for(int i=0;i<n;i++)
            cin>>v[i];
        ll max_1 = *max_element(v.begin(), v.end());
        ll min_1 = *min_element(v.begin(), v.end());
        find(v, max_1, min_1);
        while(k--)
        {
            int l; cin>>l;
            if(ma1[l]) cout<<"YES\n";
            else
                cout<<"NO\n";
        }
    }
}