#include<bits/stdc++.h>
using namespace std;
int *tests, *arr;
bool* flags;
map<long long, bool> hmap;
void prettinessTest(int s, int e)
{
  if(s > e)
  {return;}
  long long sum = 0;
  int mid = (arr[s] + arr[e]) / 2, pos = -1;
  for(int i = s; i <= e; i++)
  {
    sum += arr[i];
    if(arr[i] > mid && pos == -1)
    {pos = i;}
  }
  hmap[sum] = true;
  if(pos == -1)
  {return;}
  prettinessTest(s, pos - 1);
  prettinessTest(pos, e);
}
void solution()
{
  int n, q;
  cin >> n >> q;
  tests = new int[q];
  flags = new bool[q]{};
  arr = new int[n];
  for(int i = 0; i < n; i++)
  {cin >> arr[i];}
  for(int i = 0; i < q; i++)
  {cin >> tests[i];}
  sort(arr, arr + n);
  hmap.clear();
  prettinessTest(0, n - 1);
  for(int i = 0; i < q; i++)
  {
    if(hmap[tests[i]])
    {cout << "YES" << endl;}
    else
    {cout << "NO" << endl;}
  }
  delete[] tests;
  delete[] flags;
  delete[] arr;
  return;
}

int main()
{
  int count, counter = 0;
  cin >> count;
  while(counter++ < count)
  {solution();}
  return 0;
}
