﻿#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>

using namespace std;

typedef long long ll;

int x[100005];
double p[100005];

ll sum[1000005];
ll pre[1000005];
map<ll, bool> expectedSet;  //
int expected[100005];
vector<int> distinctNum;  //
vector<pair<int, int>> allRange;  // 

void wmp(int l, int r) {
    if (l > r) {
        return;
    }
    allRange.push_back({ l,r });
    if (l == r) {
        return;
    }

    int mid = (distinctNum[l] + distinctNum[r]) / 2;
    int j;
    for (j = r; j >= l; j--) {
        if (distinctNum[j] <= mid) {
            break;
        }
    }
    wmp(l, j);
    wmp(j + 1, r);
}

ll getSum(int l, int r) {
    if (l == 0) {
        return pre[r];
    }
    return pre[r] - pre[l - 1];
}

int main()
{
    int t;
    scanf("%d", &t);

    for (int tt = 0; tt < t; tt++) {
        int n, m;
        scanf("%d%d", &n, &m);

        for (int i = 0; i <= 1000004; i++) {
            sum[i] = 0;
        }
        expectedSet.clear();
        distinctNum.clear();
        allRange.clear();

        for (int i = 1; i <= n; i++) {
            scanf("%d", &x[i]);
        }

        for (int i = 1; i <= n; i++) {
            sum[x[i]] += x[i];
        }

        vector<ll> distinctSum;
        for (int i = 1; i <= 1000000; i++) {
            if (sum[i] > 0) {
                distinctSum.push_back(sum[i]);
                distinctNum.push_back(i);
            }
        }

        wmp(0, distinctNum.size() - 1);

        for (int i = 0; i < distinctSum.size(); i++) {
            if (i == 0) {
                pre[i] = distinctSum[i];
                continue;
            }
            pre[i] = pre[i - 1] + distinctSum[i];
        }


        for (int i = 0; i < m; i++) {
            scanf("%d", &expected[i]);
            expectedSet[expected[i]] = false;
        }
        
        for (auto p : allRange) {
            ll tmp = getSum(p.first, p.second);
            if (expectedSet.count(tmp)) {
                expectedSet[tmp] = true;
            }
        }

        for (int i = 0; i < m; i++) {
            printf("%s\n", expectedSet[expected[i]] ? "Yes" : "No");
        }
    }

    return 0;
}
