#include<bits/stdc++.h>
#define pr pair<int, int> 
#define x first
#define y second
#define vc vector
#define pp push_back
using namespace std;
const int N = 2e5 + 5;
const int mod = 1e9 + 7;
int n, m, k, t, z, w, x, y;
//char ch[505][505];
int a[N];
map<long long, int> mp;

void make(vector<int> &a) {
    vector<int> A,B;
    if(a.empty())
        return;
    int MAX = a[0], MIN = a[0];
    long long sum = 0;
    for (int i = 0; i < a.size(); i++) {
        int x = a[i];
        MAX = max(MAX, x), MIN = min(MIN, x), sum += x;
    }
    mp[sum]=1;
    if (MAX == MIN)
        return;
    int mid = (MAX + MIN) >> 1;
    for (int i = 0; i < a.size(); i++) {
        int x = a[i];
        if(x <= mid)
            A.pp(x);
        else
            B.pp(x);
    }
    make(A), make(B);
}

void solve() {
    double ans = 1;
    scanf("%d%d", &n, &m);
    mp.clear();
    vector<int> a(n);
    for (int i = 0; i < n; i++)
        scanf("%d", &a[i]);
    make(a);
    for (int i = 1; i <= m; i++) {
        long long x;
        scanf("%lld", &x);
        if(mp.count(x))
            puts("yes");
        else
            puts("no");
    }
}

int main() {
    int T; scanf("%d", &T);
    for (int i = 1; i <= T; i++)
        solve();
}