#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <list>
#include <stack>
#include <sstream>
#include <string>
#include <fstream>
#include <set>

using namespace std;
using ll = long long int;

void recur(ll l, ll r, vector<ll>& a, vector<ll>& p, set<ll>& vals) {
    //cout << l << ' ' << r << endl;
    if (l == r) {
        vals.insert(a[l]);
        return;
    }
    ll cur_sum = p[r];
    if (l != 0) cur_sum -= p[l-1];
    vals.insert(cur_sum);

    ll mid = (a[l] + a[r]) / 2;
    ll id = upper_bound(a.begin() + l, a.begin() + r + 1, mid) - a.begin();
    if (id == r + 1) {
        return;
    }
    recur(l, id - 1, a, p, vals);
    recur(id, r, a, p, vals);
}

int main() {
    ll T; cin >> T;
    for (ll qq = 1; qq <= T; qq++) {
        ll n, q; cin >> n >> q;
        vector<ll> a(n,0);
        vector<ll> s(q,0);
        for (ll i = 0; i < n; i++) cin >> a[i];
        for (ll i = 0; i < q; i++) cin >> s[i];
        sort(a.begin(), a.end());
        vector<ll> prefix(n, a[0]);
        for (ll i = 1; i < n; i++) {
            prefix[i] = prefix[i-1] + a[i];
        }
        set<ll> vals;

        recur(0, n - 1, a, prefix, vals);

        for (ll i = 0; i < s.size(); i++) {
            if (vals.find(s[i]) == vals.end()) {
                cout << "No" << endl;
            } else {
                cout << "Yes" << endl;
            }
        }


    }

}