#include <iostream>
#include<string>
#include<unordered_map>
using namespace std;
//使用const string&来加快运行速度
bool judge(const string& A, const string& B) {
int i = 0, j = 0;
while (i < A.size() && j < B.size()) {
if (A[i] == B[j]) {
j++;
}
i++;
}
if(j == B.size())cout<<"Yes"<<endl;
else cout<<"No"<<endl;
return true;
}
int main() {
string str,sonstr;
int n;
cin>>str>>n;
while(n--){
cin>>sonstr;
judge(str,sonstr);
}
return 0;
}

京公网安备 11010502036488号