#include<bits/stdc++.h>
#define int long long
using namespace std;
auto IN = freopen("subsequence.in", "r", stdin);
auto OUT = freopen("subsequence.out", "w", stdout);
auto mread = [](){int x;scanf("%lld", &x);return x;};
const int N = 1e5 + 5;
char s[N], b[55];
int to[N][30], n;
signed main(){
scanf("%s", s + 1);
n = strlen(s + 1);
int la[30];
for(int i = 0; i < 26; i ++){
la[i] = n + 1;
}
for(int i = n; i >= 1; i --){
la[s[i] - 'a'] = i;
for(int j = 0; j < 26; j ++){
to[i][j] = la[j];
}
}
for(int j = 0; j < 26; j ++){
to[0][j] = la[j];
}
int t = mread();
while(t --){
scanf("%s", b + 1);
int m = strlen(b + 1);
int x = 0;
for(int i = 1; i <= m; i ++){
x = to[x][b[i] - 'a'];
if(x == n + 1){
printf("No\n");
break;
}
}
if(x <= n){
printf("Yes\n");
}
}
return 0;
}