#include<bits/stdc++.h>
typedef long long int ll;
#define pb push_back
#define pi  3.141592653589793238462643383279
#define int long long
#define ff first
#define ss second
#define endl '\n'
#define all(x) (x).begin(), (x).end()
#define rep(i,x,y) for(int i=(int)x; i<y; i++)
#define high_functioning_sociopath  ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
const unsigned int M = 998244353;
/*_____________________________THE GAME IS ON_____________________________*/
set<int>S;
void solve(vector<int>&v)
{
      int s0=0,mi=1e7,mx=0;
      for(auto it : v)
      {
             s0 += it;
             mi = min(it,mi);
             mx = max(it,mx);
      }
      int mid = (mi+mx)/2,s1=0,s2=0;
      vector<int>v1,v2;
      for(auto it : v)
      {
             if(it<=mid)
             {
                    s1+=it;
                    v1.pb(it);
             }
             else 
             {
                    s2+=it;
                    v2.pb(it);
             }
      }
      S.insert(s1);S.insert(s2);S.insert(s0);
      if(v1.size() > 0 && v2.size() > 0 )
      {
             solve(v1);
             solve(v2);
      }
}
int32_t main()
{
   high_functioning_sociopath
   //pre();
   ll t;
   cin>>t;
   while(t--)
   {
      S.clear();
      int n,q;
      cin >> n >> q;
      vector<int>v(n);
      for(int i=0;i<n;i++)cin >> v[i];
      solve(v);
      for(int i=0;i<q;i++)
      {
             int s;
             cin >> s;
             if(S.find(s)!=S.end())
             {
                    cout << "Yes\n";
             }
             else cout << "No\n";
      }
   }
}