#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <tuple>
#include <cstring>
#include <unordered_set>
using namespace std;

unordered_set<long long> cache;

void update(vector<int>& arr) {
    long long mid = (arr[0] + arr.back()) / 2;
    long long sum = 0;

    vector<int> L, R;
    for (int x : arr) {
        if (x <= mid) L.push_back(x);
        else R.push_back(x);

        sum += x;
    }

    cache.insert(sum);

    if (L.empty() || R.empty()) return;

    update(L);
    update(R);
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    int T;
    cin >> T;
    while (T--) {
        int N, Q;
        cin >> N >> Q;

        vector<int> arr(N);
        for (auto& x : arr) cin >> x;

        vector<int> query(Q);
        for (auto& x : query) cin >> x;

        sort(arr.begin(), arr.end());
        update(arr);

        for (auto& q : query) {
            bool ok = cache.find(q) != cache.end();
            cout << (ok ? "Yes" : "No") << "\n";
        }

        cache.clear();
    }
}

