#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
#define ll long long
#define int long long
#define endl '\n'
set<int> s;
void precompute(int l,int r,int arr[])
{

    if(l>r)
        return;
    if(l==r)
    {
        s.insert(arr[l]);
        return;
    }
    int mx=-1;
    int mi=1e18;
    int curr=0;
    for(int i=l;i<=r;i++)
    {
        mx=max(mx,arr[i]);
        mi=min(mi,arr[i]);
        curr+=arr[i];
    }

    s.insert(curr);
    if(mi==mx)
        return;
    int mid=(mx+mi)/2;
    int tmp[r-l+1];
    int ind=0;
    int split=l-1;
    for(int i=l;i<=r;i++)
    {
        if(arr[i]<=mid)
        {
            tmp[ind++]=arr[i];
            split++;
        }
    }
    for(int i=l;i<=r;i++)
    {
        if(arr[i]>mid)
            tmp[ind++]=arr[i];
    }
    for(int i=l;i<=r;i++)
        arr[i]=tmp[i-l];
    precompute(l,split,arr);
    precompute(split+1,r,arr);
}
int32_t main()
{
    int t;
    cin>>t;
    while(t--)
    {
        s.clear();
        int n,q;
        cin>>n>>q;
        int arr[n];
        for(int i=0;i<n;i++)
            cin>>arr[i];
        precompute(0,n-1,arr);
        while(q--)
        {
            int sum;
            cin>>sum;
            if(s.find(sum)==s.end())
                cout<<"NO"<<endl;
            else
                cout<<"YES"<<endl;
        }
    }
}