A. Missing Spaces

Problem

You were given some difficult course work. You had no idea at all how the questions can be answered, so you sought help from the tutor. He seemed eager to help. He spent some time to write you an email to give you hints. You opened the email. You found that the email contains one single string. You asked the tutor what happened. The tutor explained that he could not give you the answer directly, so he sent you the answer with all spaces removed! You want to add back the missing spaces in the string so you can find out the answer before deadline, but you notice that the course evaluation will be conducted tomorrow so you give priority to the task of determining whether the tutor is helpful. Can the string in the email be split into words that are found in dictionary? If so, probably the string the tutor sent you will be helpful.

Input

The input starts with the number of dictionary words w, w <= 2000. Each of the next w lines contains a dictionary word. A dictionary word is defined by a string consisting of at most 100 lower-case letters. Then the number of strings s is given, s <= 1000. Each of the next s lines contains a string. Each string consists of at most 1000 lower-case letters.

Output

For each of the s strings, print "Yes" if the string can be split into dictionary words by inserting spaces or "No" otherwise.

Sample Input


10

case

data

dynamic

efficient

handle

programming

structure

test

tricky

use

3

usedynamicprogramming

useefficientdatastructure

handletrickytestcases

Sample output


Yes

Yes

No

Author

Louis Siu