CSES - E4590 2017 6 - Family chronicle
  • Time limit: 1.00 s
  • Memory limit: 512 MB

The family chronicle of Teemu Teekkari family is a thick book. Before print, Teemu needs to check which family members are mentioned in the work.

Input

The first line of the input contains a single string, the contents of the chronicle. Each character in the string is between A-Z.

The next line contains single integer q, the number of names to be checked for. The last q lines each contain single name to be checked.

Output

For each name being checked, output single line with YES if the name is mentioned in the chronicle or NO if not.

Limits

The length of the chronicle is at most 5 \cdot 10^4 characters.

The sum of lengths of the names is at most 5 \cdot 10^4 characters.

Example

Input:

TEEMUANDTAINAMETMATTI
3
TEEMU
MATTI
JUKKA

Output:

YES
YES
NO