#include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main() {
map<ll,ll>m;
int t;
cin>>t;
while(t–)
{
ll l;
cin>>l;
ll a[l];
for(ll i=0;i<l;i++)
{
cin>>a[i];
m.insert(make_pair(a[i],i));
}
//query
ll q;
cin>>q;
while(q–){
ll ques;
cin>>ques;
map<ll, ll>::iterator it1 ;
it1 = m.find(ques);
if(it1 == m.end())
cout << "No"<<endl;
else
cout << "Yes"<<endl;
}
}
return 0;
}