/*
"اله السماء يعطينا النجاح ونحن عبيده نقوم ونبني"
"تكفيك نعمتي لان قوتي في الضعف تكمل"
created by: shady rafet
my face book : https://www.facebook.com/profile.php?id=100019579575853
never give up
one day i will do it ':(
the next master ISA

*****   ******        *           *       *********   ************     ********          *       **********
    *   *            * *         *               *   *            *    *      *         * *      *
    *   *           *   *       *               *   *              *   * ** * *        *   *     *
 ****   ******     *     *     *               *    *              *   **             *     *    **********
    *   *         *       *   *               *     *              *   *  *          * ***** *            *
    *   *        *         * *               *       *            *    *    *       *         *           *
*****   ******  *           *               *         ************     *       *   *           *  *********
*/
#include <bits/stdc++.h>
using namespace std;
#define io                        \
    ios_base::sync_with_stdio(0); \
    cin.tie(0);                   \
    cout.tie(0);
#define el '\n'
#define point complex<double>
#define rep(i, x, n) for (int i = x; i < n; i++)
#define lep(n) for (int i = n - 1; i > -1; i--)
#define all(v) v.begin(), v.end()
#define read(a, n)              \
    for (int i = 0; i < n; i++) \
        cin >> a[i];
#define pb push_back
#define mms(i, v) memset(v, i, sizeof v)
typedef long long ll;
typedef long double ld;
typedef unsigned long long ul;
const ll oo = 1e18;
const ll N = 1e6 + 5;
const ll mod = 1e9 + 7;
const double pi = acos(-1);

ll dp[N],a[N];
map<ll,int> ans ;
void fn(int s,int e)
{
    if(s>e)
        return ;
    if(s==0)
        ans[dp[e]] = 1;
        if(s==e)
        {
            ans[a[s]] = 1;
            return ;
        }
    else
    {
        ans[(dp[e]-dp[s-1])] = 1;
    }
    ll md = (a[s]+a[e])/2;
    int ss = s,ee = e,m,mm;
    while(ss<=ee)
    {
        mm = (ss+ee)/2;
        if(a[mm]<=md)
        {
            m = mm;
            ss = mm+1;
        }
        else ee = mm-1;
    }
    if(m!=e)
    fn(s,m);
    if(m+1!=s)
    fn(m+1,e);
}
int main()
{
    io;

    int t;
    cin>>t;
    while(t--)
    {
       int n,q;
       cin>>n>>q;
       for(int i = 0;i<n;i++)
           cin>>a[i];
        sort(a,a+n);
        dp[0] = a[0];
        for(int i = 1;i<n;i++)
            dp[i] = dp[i-1] + a[i];
            ans.clear();
            fn(0,n-1);
            while(q--)
            {
                int x;
                cin>>x;
                if(ans[x])
                    cout<<"YES\n";
                else cout<<"NO\n";
            }


    }


    return 0;
}
