#include<iostream>
using namespace std;
int main()
{
string s;
cin >> s;
int n;
cin >> n;
for (int i = 0; i < n; i++)
{
string le;
cin >> le;
int count = 0;
for (int j = 0; j < s.length(); j++)
{
for (int k = 0; k < le.length(); k++)
{
if (s[j] == le[k])
count++;
}
}
if (count==le.size())
cout << "Yes
";
else
cout << "No
";
}
return 0;
}
#include<iostream>
using namespace std;
int main()
{
string s;
cin >> s;
int n;
cin >> n;
for (int i = 0; i < n; i++)
{
string le;
cin >> le;
int count = 0;
for (int j = 0; j < s.length(); j++)
{
for (int k = 0; k < le.length(); k++)
{
if (s[j] == le[k])
count++;
}
}
if (count==le.size())
cout << "Yes
";
else
cout << "No
";
}
return 0;
}