At UPF there is a document with the names of all students that finished their studies, but an employee opened the wrong document in the UPF servers and accidentally deployed the Alumni virus.
The virus reads all student names and merges them into a single string that maintains the order of each name. For instance, Alumni can read alice and bob and generate a document with a single string alibobce. Both alice and bob are subsequences of this string, but another name such as bond is not. Multiple names can share letters in the generated string, e.g. Alumni can merge boben and bobby as bobebny.
UPF needs your help to write a program that determines whether or not a student name is part of a string and reports “YES” or “NO” accordingly.
The input starts with the number of test cases . For each test case, there is an intenger that represents the number of queries to answer. The following line is the output non-empty string of Alumni virus with less than characters. The next lines are strings that correspond to possible non-empty student names, and their length could be as large as . Your program should say if each student name exists in . All input strings have lowercase letters.
For each test case, output lines corresponding to each query: “YES” if the queried name exist, “NO” otherwise. Print and end of line character after each test case.
Input
2 3 alibobce alice bob bond 3 bobebny boben bone bobby
Output
YES YES NO YES NO YES