题目描述
Do you like Treasure Hunts? I like treasure hunts. Love ‘em. And TROIKA 2013 has the best one ever in ‘MIST’ (apps.facebook.com/mist_troika).
Just like a normal treasure hunt, you are given several clues and you have to get the right answer to progress to the next level and so on, until you reach the ultimate prize! But the organizers have learnt that a lot of users are not progressing even after figuring out the correct answer; it seems ‘someone’ forgot to code in ‘possible variants of the correct answer’ for each level. For example, if “Sachin Tendulkar” happened to be the answer to a particular level, “Tendulkar” or “tendulkar” or “sachin tendulkar” wasn’t accepted as correct. This is what you have to rectify.
Given the expected answer ‘S’, your job is to modify the answer-verification-system to be able to allow acceptable variants of ‘S’.
If the user enters an acceptable variant ,terminate the program. You can assume that the user is intelligent enough so that he will enter the answer in an order specified by the string S i.e he will not enter anything like “Tendulkar Sachin” if the answer is “Sachin Tendulkar” however he can enter “Tendulkar”.
Input
The first line of the input contains a string S.
The next few lines contain the input string P entered by the user.
Output
For every line entered by the user output “Yes” if the string is acceptable and “No” if it is not. (quotes only for clarity).
Contraints
1 <= length of S and P <= 10000
Example
Input 1:
Sachin Ramesh Tendulkar
Sach
Ram
sAcH Tendul
sach Tendulkar
Sachin Ram Tendulkar
SAChin TENduLkaR
Output 1:
No
No
No
No
No
Yes
Input 2:
Sachin Ramesh Tendulkar
Sach
Ram
sAcH Tendul
sach Tendulkar
Sachin Ram Tendulkar
Ramesh TENduLkaR
Output 2:
No
No
No
No
No
Yes
输入格式
见题面
输出格式
见题面