The Separatists are having trouble with the Geonosis Droid Foundry! This foundry produces B1-series battle droids, but each droid produced has many unnecessary parts. The Archduke of the Geonosians, Poggle the Lesser, asked you to salvage as many droids as possible by removing the unnecessary parts.
You are given a string baseline $$$b$$$ which represents the parts for all droids as they come out of the production line. Every produced droid appears this way. Additionally, you are given $$$n$$$ designs $$$d_1, d_2, ..., d_{n-1}, d_{n}$$$, where $$$d_i$$$ is a string that represents the parts that the $$$i$$$-th droid is supposed to have. It is guaranteed that every design is at most as long as the baseline or, more formally, $$$|d_i| \le |b|$$$ for all $$$i \in [1, n]$$$.
For each droid, determine if its design $$$d_i$$$ can be created from the baseline string $$$b$$$ by removing zero or more characters from $$$b$$$, without changing the order of the characters in $$$b$$$ or $$$d_i$$$.
The first line of input contains the string $$$b$$$ $$$(1 \le |b| \le 1000)$$$ — the baseline string consisting of uppercase letters [A-Z].
The second line contains the integer $$$n$$$ $$$(1 \le n \le 1000)$$$ — the number of designs that you must try to produce.
Each of the next $$$n$$$ lines contain a string $$$d_i$$$ $$$(1 \le |d_i| \le |b|)$$$ — the $$$i$$$-th design, also consisting of uppercase letters [A-Z].
Output $$$n$$$ lines where, on the $$$i$$$-th line, print "YES" if $$$d_i$$$ can be created from $$$b$$$ or "NO" otherwise.
ABCDEF3ACEFDCCDE
YES NO YES
JAVAJAVA4AAAAAAAVAAAAAVJAVAJAVA
YES YES NO YES
In the first test case, the first design ACEF is able to be created by removing B and D from ABCDEF.
The second design DC is impossible. Note that CD can be created by removing A, B, E, and F, but we cannot rearrange these letters to DC so this is not useful.
The third design CDE can be created by removing A, B, and F.
| Name |
|---|


