#include
#include
#include
#include
#include
#include
using namespace std;
string a[11],s;
bool cmp(string x,string y)
{
return x
bool find(string s) //折半查找
{
int l=1,r=11,k;
while(l
k=(l+r)>>1;
if(a[k]==s) return 1;
else if(a[k]l=k+1;
else r=k;
}
return 0;
}
void quick_sort(string *x,string *y,bool cmp(string,string)) //通过自定义快排函数对字符串排序
{
int m=0,n=y-x-1;
int i=m,j=n,k=rand()%(y-x);
string key=x[k];
x[k]=x[i],x[i]=key;
while(i
while(cmp(key,x[j]) && i
x[i]=key;
if(i>m) quick_sort(x,x+i,cmp);
if(i
int main()
{
for(int i=1;i<=10;i++)
cin>>a[i];
quick_sort(a+1,a+11,cmp);
while(cin>>s)
{
if(find(s)) printf("Yes\n");
else printf("No\n");
}
return 0;
}