Most operating system command-line interfaces (CLI) support wildcard matching for filenames for user convenience. The most common wildcards are two: the asterisk ("*"), which can match any sequence of zero or more characters; and the question mark ("?"), which can match exactly one character.
You are required to write a program that, given a pattern and a list of filenames, determines which files can be matched by the pattern.
Input
The first line contains a string consisting of lowercase letters and the aforementioned wildcards. The second line contains an integer $n$, representing the number of files. The following $n$ lines each contain a string consisting only of lowercase letters, representing the list of filenames.
Output
Output $n$ lines, each being "YES" or "NO", indicating whether the corresponding file can be matched by the wildcard pattern.
Data Range
For 30% of the data: * String length does not exceed 100.
For 100% of the data: String length does not exceed 100000. $1 \le n \le 100$. * The number of wildcards does not exceed 10.
Examples
Input 1
*abc?e**e 3 abcee ppabcqexe abcdefgee
Output 1
NO YES YES